diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenReadonlyStructTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenReadonlyStructTests.cs index efc9fbf9a1425..97f533a5a2d98 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenReadonlyStructTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenReadonlyStructTests.cs @@ -1357,7 +1357,7 @@ void validate(ModuleSymbol module) Assert.True(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)p4.SetMethod).Handle)); Assert.False(peModule.Module.HasIsReadOnlyAttribute(((PEPropertySymbol)p5).Handle)); - Assert.False(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)p1.GetMethod).Handle)); + Assert.False(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)p5.GetMethod).Handle)); Assert.False(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)p5.SetMethod).Handle)); AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal); diff --git a/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs index 048f228235e9b..e12b3e17a0a30 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs @@ -2078,9 +2078,24 @@ internal struct InternalStruct var refImage = comp.EmitToImageReference(emitRefOnly); var compWithRef = CreateEmptyCompilation("", references: new[] { MscorlibRef, refImage }, options: TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All)); + + var globalNamespace = compWithRef.SourceModule.GetReferencedAssemblySymbols().Last().GlobalNamespace; + AssertEx.Equal( - new[] { "", "InternalStruct" }, - compWithRef.SourceModule.GetReferencedAssemblySymbols().Last().GlobalNamespace.GetMembers().Select(m => m.ToDisplayString())); + new[] { "", "InternalStruct", "Microsoft", "System" }, + globalNamespace.GetMembers().Select(m => m.ToDisplayString())); + + AssertEx.Equal(new[] { "Microsoft.CodeAnalysis" }, globalNamespace.GetMember("Microsoft").GetMembers().Select(m => m.ToDisplayString())); + AssertEx.Equal( + new[] { "Microsoft.CodeAnalysis.EmbeddedAttribute" }, + globalNamespace.GetMember("Microsoft.CodeAnalysis").GetMembers().Select(m => m.ToDisplayString())); + + AssertEx.Equal( + new[] { "System.Runtime.CompilerServices" }, + globalNamespace.GetMember("System.Runtime").GetMembers().Select(m => m.ToDisplayString())); + AssertEx.Equal( + new[] { "System.Runtime.CompilerServices.IsReadOnlyAttribute" }, + globalNamespace.GetMember("System.Runtime.CompilerServices").GetMembers().Select(m => m.ToDisplayString())); AssertEx.Equal( new[] { "System.Int32 InternalStruct.

k__BackingField", "InternalStruct..ctor()" },