You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix CustomAttributeData in the presence of generic attributes (#56879)
* Fix CustomAttributeData in the presence of generic attributes
- Generic attributes need to force the actual exact method to be loaded not just the canonical scenario
- GenericAttribute testing had been disabled due to dotnet/msbuild#6734
- Move GenericAttribute test project to Pri0 as its the only generic custom attribute runtime testing that will occur before .NET 6.0 ships
- Test disabled on Mono as Mono currently doesn't support this feature.
Fixes#56492
<DisabledProjectsInclude="$(TestRoot)Loader\classloader\StaticVirtualMethods\**\generatetest.csproj" /> <!-- test generators -->
18
18
<DisabledProjectsInclude="$(TestRoot)Performance\Scenario\JitBench\unofficial_dotnet\JitBench.csproj" /> <!-- no official build support for SDK-style netcoreapp2.0 projects -->
AssertAny(a1_data, a =>a.AttributeType==typeof(SingleAttribute<int>));
162
+
AssertAny(a1_data, a =>a.AttributeType==typeof(SingleAttribute<bool>));
163
+
164
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<int>)&&a.ConstructorArguments.Count==0&&a.NamedArguments.Count==0);
165
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<int>)&&a.ConstructorArguments.Count==1&&a.NamedArguments.Count==0&&a.ConstructorArguments[0].ArgumentType==typeof(int)&&((int)a.ConstructorArguments[0].Value)==1);
166
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<int>)&&a.ConstructorArguments.Count==0&&a.NamedArguments.Count==1&&a.NamedArguments[0].TypedValue.ArgumentType==typeof(int)&&((int)a.NamedArguments[0].TypedValue.Value)==2);
167
+
168
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<bool>)&&a.ConstructorArguments.Count==0&&a.NamedArguments.Count==0);
169
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<bool>)&&a.ConstructorArguments.Count==1&&a.NamedArguments.Count==0&&a.ConstructorArguments[0].ArgumentType==typeof(bool)&&((bool)a.ConstructorArguments[0].Value)==true);
170
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<bool>)&&a.ConstructorArguments.Count==0&&a.NamedArguments.Count==1&&a.NamedArguments[0].TypedValue.ArgumentType==typeof(bool)&&((bool)a.NamedArguments[0].TypedValue.Value)==true);
171
+
172
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<bool?>)&&a.ConstructorArguments.Count==0&&a.NamedArguments.Count==0);
173
+
174
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<Type>)&&a.ConstructorArguments.Count==1&&a.NamedArguments.Count==0&&a.ConstructorArguments[0].ArgumentType==typeof(Type)&&((Type)a.ConstructorArguments[0].Value)==typeof(Class));
175
+
AssertAny(a1_data, a =>a.AttributeType==typeof(MultiAttribute<Type>)&&a.ConstructorArguments.Count==0&&a.NamedArguments.Count==1&&a.NamedArguments[0].TypedValue.ArgumentType==typeof(Type)&&((Type)a.NamedArguments[0].TypedValue.Value)==typeof(Class.Derive));
0 commit comments