Skip to content

Commit 79eae6a

Browse files
committed
[bgen] Handle in-process warning differences
Treat the .NET and NUnit OverloadResolutionPriorityAttribute definitions as an expected polyfill collision while preserving the attribute for generated bindings. Account for intentional binding-test diagnostics now surfaced through the in-process MSBuild logger. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0de016bf-f41d-4d46-aab1-34c9850c8f4b
1 parent 78e9880 commit 79eae6a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/bgen/AttributeManager.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class AttributeManager {
1919
"System.Runtime.CompilerServices.NullableContextAttribute",
2020
"System.Runtime.CompilerServices.NativeIntegerAttribute",
2121
"System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute",
22+
"System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute",
2223
};
2324

2425
// Cache raw GetCustomAttributesData() results per provider to avoid repeated reflection allocations.

‎tests/dotnet/UnitTests/ProjectTest.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,6 +3050,10 @@ public void PublishAotMonoTouchTest_NoIL2009 (ApplePlatform platform, string run
30503050
.FilterWarnings (platform);
30513051
var expectedWarnings = new ExpectedBuildMessage [] {
30523052
new ExpectedBuildMessage ($"ILC", $"MonoTouchFixtures.ObjCRuntime.ClassTest.GetHandle(): Using member 'System.Type.MakeArrayType()' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The code for an array of the specified type might not be available."),
3053+
new ExpectedBuildMessage ($"MSBuild", $"The type Bindings.Test.Protocol.P2 has a [Protocol] and a [BaseType] attribute, but no [Model] attribute. This is likely incorrect; either remove the [BaseType] attribute, or add a [Model] attribute."),
3054+
new ExpectedBuildMessage ($"MSBuild", $"The type Bindings.Test.ProtocolWithBlockProperties has a [Protocol] and a [BaseType] attribute, but no [Model] attribute. This is likely incorrect; either remove the [BaseType] attribute, or add a [Model] attribute."),
3055+
new ExpectedBuildMessage ($"MSBuild", $"[NullAllowed] should not be used on methods, like 'Element GetElement(Key)', but only on properties, parameters and return values."),
3056+
new ExpectedBuildMessage ($"MSBuild", $"[NullAllowed] should not be used on methods, like 'Foundation.NSEnumerator`1[Element] GetEnumerator()', but only on properties, parameters and return values."),
30533057
new ExpectedBuildMessage ($"MSBuild", $"It's not safe to remove the dynamic registrar, because monotouchtest references 'ObjCRuntime.Runtime.ConnectMethod (System.Reflection.MethodInfo, ObjCRuntime.Selector)'."),
30543058
new ExpectedBuildMessage ($"MSBuild", $"It's not safe to remove the dynamic registrar, because monotouchtest references 'ObjCRuntime.Runtime.ConnectMethod (System.Type, System.Reflection.MethodInfo, Foundation.ExportAttribute)'."),
30553059
new ExpectedBuildMessage ($"MSBuild", $"It's not safe to remove the dynamic registrar, because monotouchtest references 'ObjCRuntime.Runtime.ConnectMethod (System.Type, System.Reflection.MethodInfo, ObjCRuntime.Selector)'."),

0 commit comments

Comments
 (0)