@@ -1094,7 +1094,8 @@ static TypeSymbol getConstraintType(CSharpCompilation comp) =>
10941094 comp.GetMember<MethodSymbol>("B.F").TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0].Type;
10951095 }
10961096
1097- [ConditionalFact(typeof(NoUsedAssembliesValidation))] // The test hook is blocked by https://github.com/dotnet/roslyn/issues/49845
1097+ [Fact]
1098+ [WorkItem(49845, "https://github.com/dotnet/roslyn/issues/49845")]
10981099 public void Retargeting_06()
10991100 {
11001101 var source1 =
@@ -1108,6 +1109,25 @@ public struct Boolean { }
11081109 public struct Int32 { }
11091110 public class IntPtr { }
11101111 public class UIntPtr { }
1112+
1113+ public class Attribute {}
1114+
1115+ public class Enum {}
1116+ public enum AttributeTargets
1117+ {
1118+ Class = 0x4,
1119+ }
1120+
1121+ [AttributeUsage(AttributeTargets.Class, Inherited = true)]
1122+ public sealed class AttributeUsageAttribute : Attribute
1123+ {
1124+ public bool AllowMultiple {get; set;}
1125+ public bool Inherited {get; set;}
1126+ public AttributeTargets ValidOn => 0;
1127+ public AttributeUsageAttribute(AttributeTargets validOn)
1128+ {
1129+ }
1130+ }
11111131}";
11121132 var comp = CreateCompilation(new AssemblyIdentity("c804cc09-8f73-44a1-9cfe-9567bed1def6", new Version(1, 0, 0, 0)), new[] { source1 }, references: null);
11131133 var ref1 = comp.EmitToImageReference();
@@ -1117,6 +1137,7 @@ public class UIntPtr { }
11171137{
11181138}";
11191139 comp = CreateEmptyCompilation(sourceA, references: new[] { ref1 }, parseOptions: TestOptions.Regular9);
1140+ comp.VerifyEmitDiagnostics();
11201141
11211142 var refA = comp.ToMetadataReference();
11221143 var typeA = comp.GetMember<NamedTypeSymbol>("A").BaseTypeNoUseSiteDiagnostics;
0 commit comments