From 3323bf3a96dd9d27fa47b1f3671ac2e316ea28bf Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Fri, 22 Jan 2021 08:40:56 -0800 Subject: [PATCH] Move tests to net5.0 reference assemblies (#50486) * Move tests to net5.0 reference assemblies This moves our tests to use the net5.0 reference assemblies. --- eng/Versions.props | 2 +- .../EditAndContinue/EditAndContinueTests.cs | 2 +- .../Semantics/NullableReferenceTypesTests.cs | 5 +- .../Symbol/Symbols/CorLibrary/CorTypes.cs | 1 - .../DefaultInterfaceImplementationTests.cs | 54 +++++++++------ .../ModuleInitializers/SignatureTests.cs | 2 - .../Core/CodeAnalysisTest/CorLibTypesTests.cs | 1 - .../Core/Compilation/CompilationExtensions.cs | 67 +++++++++++++++++++ src/Compilers/Test/Core/Generate.ps1 | 3 +- src/Compilers/Test/Core/Generated.cs | 3 - src/Compilers/Test/Core/Generated.targets | 30 ++++----- .../Test/Core/TargetFrameworkUtil.cs | 2 +- .../SymbolsTests/CorLibrary/CorTypes.vb | 1 - .../DefaultInterfaceImplementationTests.vb | 8 ++- 14 files changed, 126 insertions(+), 55 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index b841e2c6cdb1d..2349eb0273504 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -100,7 +100,7 @@ 8.0.0 2.2.101 2.1.2 - 3.1.0 + 5.0.0 1.0.0 1.0.0 1.0.0 diff --git a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs index 8d9121ee3c7c7..ab9ca90c11e97 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs @@ -2079,7 +2079,7 @@ interface J { } CheckEncLog(reader2, Row(3, TableIndex.AssemblyRef, EditAndContinueOperation.Default), - Row(8, TableIndex.TypeRef, EditAndContinueOperation.Default), + Row(10, TableIndex.TypeRef, EditAndContinueOperation.Default), Row(2, TableIndex.Event, EditAndContinueOperation.Default), Row(3, TableIndex.Event, EditAndContinueOperation.Default), Row(1, TableIndex.Field, EditAndContinueOperation.Default), diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs index 73abb30737811..3d0ad3cac20b6 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs @@ -141722,10 +141722,7 @@ public void Test() } }"; var comp = CreateCompilation( - new[] - { - source, MemberNotNullAttributeDefinition - }, + new[] { source }, options: WithNonNullTypesTrue(), targetFramework: TargetFramework.NetCoreApp, parseOptions: TestOptions.Regular9); diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs index 7f5290daf8fa2..c2bec40bfff6b 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs @@ -55,7 +55,6 @@ public void PresentCorLib() var knownMissingTypes = new HashSet() { - (int)SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute }; for (int i = 1; i <= (int)SpecialType.Count; i++) diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/DefaultInterfaceImplementationTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/DefaultInterfaceImplementationTests.cs index 8c0a7e4a3c5cb..9ab95e30cbd54 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/DefaultInterfaceImplementationTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/DefaultInterfaceImplementationTests.cs @@ -5,7 +5,10 @@ #nullable disable using System; +using System.Collections.Immutable; +using System.Diagnostics; using System.Linq; +using System.Text; using System.Threading; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE; @@ -54945,31 +54948,44 @@ private static string BuildAssemblyExternClause(PortableExecutableReference refe Version version = assemblyIdentity.Version; var publicKeyToken = assemblyIdentity.PublicKeyToken; - return @" -.assembly extern " + assemblyIdentity.Name + @" -{ - .publickeytoken = (" + - publicKeyToken[0].ToString("X2") + - publicKeyToken[1].ToString("X2") + - publicKeyToken[2].ToString("X2") + - publicKeyToken[3].ToString("X2") + - publicKeyToken[4].ToString("X2") + - publicKeyToken[5].ToString("X2") + - publicKeyToken[6].ToString("X2") + - publicKeyToken[7].ToString("X2") + -@" ) - .ver " + $"{version.Major}:{version.Minor}:{version.Build}:{version.Revision}" + @" -} + if (publicKeyToken.Length > 0) + { + return @" + .assembly extern " + assemblyIdentity.Name + @" + { + .publickeytoken = (" + + publicKeyToken[0].ToString("X2") + + publicKeyToken[1].ToString("X2") + + publicKeyToken[2].ToString("X2") + + publicKeyToken[3].ToString("X2") + + publicKeyToken[4].ToString("X2") + + publicKeyToken[5].ToString("X2") + + publicKeyToken[6].ToString("X2") + + publicKeyToken[7].ToString("X2") + + @" ) + .ver " + $"{version.Major}:{version.Minor}:{version.Build}:{version.Revision}" + @" + } +"; + } + else + { + return @" + .assembly extern " + assemblyIdentity.Name + @" + { + .ver " + $"{version.Major}:{version.Minor}:{version.Build}:{version.Revision}" + @" + } "; + } } [Fact] [WorkItem(36532, "https://github.com/dotnet/roslyn/issues/36532")] public void WindowsRuntimeEvent_01() { + var windowsRuntimeRef = CompilationExtensions.CreateWindowsRuntimeMetadataReference(); var ilSource = BuildAssemblyExternClause(TestMetadata.NetCoreApp.SystemRuntime) + -BuildAssemblyExternClause(TestMetadata.NetCoreApp.SystemRuntimeInteropServicesWindowsRuntime) + +BuildAssemblyExternClause(windowsRuntimeRef) + @" .class public auto ansi sealed Event extends [System.Runtime]System.MulticastDelegate @@ -55052,7 +55068,7 @@ class C1 : I1, Interface "; foreach (var options in new[] { TestOptions.DebugDll, TestOptions.DebugWinMD }) { - var comp = CreateCompilationWithIL(source, ilSource, options: options, targetFramework: TargetFramework.NetCoreApp); + var comp = CreateCompilationWithIL(source, ilSource, options: options, targetFramework: TargetFramework.NetCoreApp, references: new[] { windowsRuntimeRef }); void Validate(ModuleSymbol m) { @@ -55125,7 +55141,7 @@ class C1 : I1 { } "; - var comp = CreateCompilation(source, options: TestOptions.DebugWinMD, targetFramework: TargetFramework.NetCoreApp); + var comp = CreateCompilation(source, options: TestOptions.DebugWinMD, targetFramework: TargetFramework.NetCoreApp, references: new[] { CompilationExtensions.CreateWindowsRuntimeMetadataReference() }); void Validate(ModuleSymbol m) { @@ -55178,7 +55194,7 @@ event System.Action Interface.WinRT class C1 : I1, Interface {} "; - var comp = CreateCompilation(source, options: TestOptions.DebugWinMD, targetFramework: TargetFramework.NetCoreApp); + var comp = CreateCompilation(source, options: TestOptions.DebugWinMD, targetFramework: TargetFramework.NetCoreApp, references: new[] { CompilationExtensions.CreateWindowsRuntimeMetadataReference() }); void Validate(ModuleSymbol m) { diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/ModuleInitializers/SignatureTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/ModuleInitializers/SignatureTests.cs index 5e7815f8ef8eb..5ceaf92406137 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/ModuleInitializers/SignatureTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/ModuleInitializers/SignatureTests.cs @@ -52,8 +52,6 @@ interface i [ModuleInitializer] internal void M2() { } } - -namespace System.Runtime.CompilerServices { class ModuleInitializerAttribute : System.Attribute { } } "; var compilation = CreateCompilation(source, parseOptions: s_parseOptions, targetFramework: TargetFramework.NetCoreApp); compilation.VerifyEmitDiagnostics( diff --git a/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs b/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs index bf3ed90936c84..1e05d8cf8bce9 100644 --- a/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs +++ b/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs @@ -70,7 +70,6 @@ public void SpecialTypeIsValueType() var knownMissingTypes = new HashSet() { - SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute }; for (var specialType = SpecialType.None + 1; specialType <= SpecialType.Count; specialType++) diff --git a/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs b/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs index 80deeb71b89c7..f5e03833d440d 100644 --- a/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs +++ b/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs @@ -15,6 +15,7 @@ using System.Text.RegularExpressions; using System.Threading; using Microsoft.CodeAnalysis.CodeGen; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Emit; using Microsoft.CodeAnalysis.FlowAnalysis; using Microsoft.CodeAnalysis.Operations; @@ -96,6 +97,13 @@ public static MemoryStream EmitToStream(this Compilation compilation, EmitOption } public static MetadataReference EmitToImageReference( + this Compilation comp, + EmitOptions options = null, + bool embedInteropTypes = false, + ImmutableArray aliases = default, + DiagnosticDescription[] expectedWarnings = null) => EmitToPortableExecutableReference(comp, options, embedInteropTypes, aliases, expectedWarnings); + + public static PortableExecutableReference EmitToPortableExecutableReference( this Compilation comp, EmitOptions options = null, bool embedInteropTypes = false, @@ -361,5 +369,64 @@ void checkControlFlowGraph(IOperation root) } } } + + /// + /// The reference assembly System.Runtime.InteropServices.WindowsRuntime was removed in net5.0. This builds + /// up which contains all of the well known types that were used from that + /// reference by the compiler. + /// + public static PortableExecutableReference CreateWindowsRuntimeMetadataReference() + { + var source = @" +namespace System.Runtime.InteropServices.WindowsRuntime +{ + public struct EventRegistrationToken { } + + public sealed class EventRegistrationTokenTable where T : class + { + public T InvocationList { get; set; } + + public static EventRegistrationTokenTable GetOrCreateEventRegistrationTokenTable(ref EventRegistrationTokenTable refEventTable) + { + throw null; + } + + public void RemoveEventHandler(EventRegistrationToken token) + { + } + + public void RemoveEventHandler(T handler) + { + } + } + + public static class WindowsRuntimeMarshal + { + public static void AddEventHandler(Func addMethod, Action removeMethod, T handler) + { + } + + public static void RemoveAllEventHandlers(Action removeMethod) + { + } + + public static void RemoveEventHandler(Action removeMethod, T handler) + { + } + } +} +"; + + // The actual System.Runtime.InteropServices.WindowsRuntime DLL has a public key of + // b03f5f7f11d50a3a and version 4.0.4.0. The compiler just looks at these via + // WellKnownTypes and WellKnownMembers so it can be safely skipped here. + var compilation = CSharpCompilation.Create( + "System.Runtime.InteropServices.WindowsRuntime", + new[] { CSharpSyntaxTree.ParseText(source) }, + references: TargetFrameworkUtil.GetReferences(TargetFramework.NetCoreApp), + options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + compilation.VerifyEmitDiagnostics(); + return compilation.EmitToPortableExecutableReference(); + } } } diff --git a/src/Compilers/Test/Core/Generate.ps1 b/src/Compilers/Test/Core/Generate.ps1 index 16ee7516ca959..3373aed32601a 100644 --- a/src/Compilers/Test/Core/Generate.ps1 +++ b/src/Compilers/Test/Core/Generate.ps1 @@ -144,7 +144,7 @@ Add-TargetFramework "Net461" '$(PkgMicrosoft_NETFramework_ReferenceAssemblies_ne 'Microsoft.VisualBasic.dll' ) -Add-TargetFramework "NetCoreApp" '$(PkgMicrosoft_NETCore_App_Ref)\ref\netcoreapp3.1' @( +Add-TargetFramework "NetCoreApp" '$(PkgMicrosoft_NETCore_App_Ref)\ref\net5.0' @( 'mscorlib.dll', 'System.dll', 'System.Core.dll', @@ -154,7 +154,6 @@ Add-TargetFramework "NetCoreApp" '$(PkgMicrosoft_NETCore_App_Ref)\ref\netcoreapp 'System.Linq.Expressions.dll', 'System.Runtime.dll', 'System.Runtime.InteropServices.dll', - 'System.Runtime.InteropServices.WindowsRuntime.dll', 'System.Threading.Tasks.dll', 'netstandard.dll', 'Microsoft.CSharp.dll', diff --git a/src/Compilers/Test/Core/Generated.cs b/src/Compilers/Test/Core/Generated.cs index 36ffe18cc5df4..7cc3f66162a86 100644 --- a/src/Compilers/Test/Core/Generated.cs +++ b/src/Compilers/Test/Core/Generated.cs @@ -176,8 +176,6 @@ public static class ResourcesNetCoreApp public static byte[] SystemRuntime => ResourceLoader.GetOrCreateResource(ref _SystemRuntime, "netcoreapp.System.Runtime.dll"); private static byte[] _SystemRuntimeInteropServices; public static byte[] SystemRuntimeInteropServices => ResourceLoader.GetOrCreateResource(ref _SystemRuntimeInteropServices, "netcoreapp.System.Runtime.InteropServices.dll"); - private static byte[] _SystemRuntimeInteropServicesWindowsRuntime; - public static byte[] SystemRuntimeInteropServicesWindowsRuntime => ResourceLoader.GetOrCreateResource(ref _SystemRuntimeInteropServicesWindowsRuntime, "netcoreapp.System.Runtime.InteropServices.WindowsRuntime.dll"); private static byte[] _SystemThreadingTasks; public static byte[] SystemThreadingTasks => ResourceLoader.GetOrCreateResource(ref _SystemThreadingTasks, "netcoreapp.System.Threading.Tasks.dll"); private static byte[] _netstandard; @@ -198,7 +196,6 @@ public static class NetCoreApp public static PortableExecutableReference SystemLinqExpressions { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.SystemLinqExpressions).GetReference(display: "System.Linq.Expressions.dll (netcoreapp)"); public static PortableExecutableReference SystemRuntime { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.SystemRuntime).GetReference(display: "System.Runtime.dll (netcoreapp)"); public static PortableExecutableReference SystemRuntimeInteropServices { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.SystemRuntimeInteropServices).GetReference(display: "System.Runtime.InteropServices.dll (netcoreapp)"); - public static PortableExecutableReference SystemRuntimeInteropServicesWindowsRuntime { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.SystemRuntimeInteropServicesWindowsRuntime).GetReference(display: "System.Runtime.InteropServices.WindowsRuntime.dll (netcoreapp)"); public static PortableExecutableReference SystemThreadingTasks { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.SystemThreadingTasks).GetReference(display: "System.Threading.Tasks.dll (netcoreapp)"); public static PortableExecutableReference netstandard { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.netstandard).GetReference(display: "netstandard.dll (netcoreapp)"); public static PortableExecutableReference MicrosoftCSharp { get; } = AssemblyMetadata.CreateFromImage(ResourcesNetCoreApp.MicrosoftCSharp).GetReference(display: "Microsoft.CSharp.dll (netcoreapp)"); diff --git a/src/Compilers/Test/Core/Generated.targets b/src/Compilers/Test/Core/Generated.targets index efde5c7cdaeb0..4a8749b6331b5 100644 --- a/src/Compilers/Test/Core/Generated.targets +++ b/src/Compilers/Test/Core/Generated.targets @@ -152,59 +152,55 @@ net461.Microsoft.VisualBasic.dll Resources\ReferenceAssemblies\net461\Microsoft.VisualBasic.dll - + netcoreapp.mscorlib.dll Resources\ReferenceAssemblies\netcoreapp\mscorlib.dll - + netcoreapp.System.dll Resources\ReferenceAssemblies\netcoreapp\System.dll - + netcoreapp.System.Core.dll Resources\ReferenceAssemblies\netcoreapp\System.Core.dll - + netcoreapp.System.Collections.dll Resources\ReferenceAssemblies\netcoreapp\System.Collections.dll - + netcoreapp.System.Console.dll Resources\ReferenceAssemblies\netcoreapp\System.Console.dll - + netcoreapp.System.Linq.dll Resources\ReferenceAssemblies\netcoreapp\System.Linq.dll - + netcoreapp.System.Linq.Expressions.dll Resources\ReferenceAssemblies\netcoreapp\System.Linq.Expressions.dll - + netcoreapp.System.Runtime.dll Resources\ReferenceAssemblies\netcoreapp\System.Runtime.dll - + netcoreapp.System.Runtime.InteropServices.dll Resources\ReferenceAssemblies\netcoreapp\System.Runtime.InteropServices.dll - - netcoreapp.System.Runtime.InteropServices.WindowsRuntime.dll - Resources\ReferenceAssemblies\netcoreapp\System.Runtime.InteropServices.WindowsRuntime.dll - - + netcoreapp.System.Threading.Tasks.dll Resources\ReferenceAssemblies\netcoreapp\System.Threading.Tasks.dll - + netcoreapp.netstandard.dll Resources\ReferenceAssemblies\netcoreapp\netstandard.dll - + netcoreapp.Microsoft.CSharp.dll Resources\ReferenceAssemblies\netcoreapp\Microsoft.CSharp.dll - + netcoreapp.Microsoft.VisualBasic.dll Resources\ReferenceAssemblies\netcoreapp\Microsoft.VisualBasic.dll diff --git a/src/Compilers/Test/Core/TargetFrameworkUtil.cs b/src/Compilers/Test/Core/TargetFrameworkUtil.cs index 0ddf29b5e336d..19e683b3fe892 100644 --- a/src/Compilers/Test/Core/TargetFrameworkUtil.cs +++ b/src/Compilers/Test/Core/TargetFrameworkUtil.cs @@ -96,7 +96,7 @@ public static class TargetFrameworkUtil public static ImmutableArray NetStandard20References => ImmutableArray.Create(NetStandard20.netstandard, NetStandard20.mscorlib, NetStandard20.SystemRuntime, NetStandard20.SystemCore, NetStandard20.SystemDynamicRuntime, NetStandard20.SystemLinq, NetStandard20.SystemLinqExpressions); public static ImmutableArray NetCoreAppReferences => ImmutableArray.Create(NetCoreApp.netstandard, NetCoreApp.mscorlib, NetCoreApp.SystemRuntime, NetCoreApp.SystemCore, NetCoreApp.SystemConsole, NetCoreApp.SystemLinq, NetCoreApp.SystemLinqExpressions, NetCoreApp.SystemThreadingTasks, - NetCoreApp.SystemCollections, NetCoreApp.SystemRuntimeInteropServicesWindowsRuntime); + NetCoreApp.SystemCollections); public static ImmutableArray WinRTReferences => ImmutableArray.Create(TestBase.WinRtRefs); public static ImmutableArray StandardReferences => RuntimeUtilities.IsCoreClrRuntime ? NetStandard20References : Mscorlib46ExtendedReferences; public static ImmutableArray StandardLatestReferences => RuntimeUtilities.IsCoreClrRuntime ? NetCoreAppReferences : Mscorlib46ExtendedReferences; diff --git a/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/CorLibrary/CorTypes.vb b/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/CorLibrary/CorTypes.vb index bb77d55a632b5..c3869bf2bd4fb 100644 --- a/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/CorLibrary/CorTypes.vb +++ b/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/CorLibrary/CorTypes.vb @@ -38,7 +38,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Symbols.CorLibrary Dim msCorLibRef As MetadataOrSourceAssemblySymbol = DirectCast(assemblies(0), MetadataOrSourceAssemblySymbol) Dim knownMissingTypes As HashSet(Of Integer) = New HashSet(Of Integer) - knownMissingTypes.Add(SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute) For i As Integer = 1 To SpecialType.Count Dim t = msCorLibRef.GetSpecialType(CType(i, SpecialType)) diff --git a/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/DefaultInterfaceImplementationTests.vb b/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/DefaultInterfaceImplementationTests.vb index fdc0c9e23421e..9b5835979f644 100644 --- a/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/DefaultInterfaceImplementationTests.vb +++ b/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/DefaultInterfaceImplementationTests.vb @@ -11805,7 +11805,11 @@ public interface I2 : I1 } } " - Dim csCompilation = GetCSharpCompilation(csSource, compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.WindowsRuntimeMetadata)).EmitToImageReference() + Dim csCompilation = GetCSharpCompilation( + csSource, + compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.WindowsRuntimeMetadata), + targetFramework:=TargetFramework.NetCoreApp, + additionalReferences:=New MetadataReference() {CompilationExtensions.CreateWindowsRuntimeMetadataReference()}).EmitToImageReference() Dim source1 = @@ -11840,7 +11844,7 @@ End Class ]]> - Dim comp1 = CreateCompilation(source1, options:=TestOptions.DebugDll, targetFramework:=TargetFramework.NetCoreApp, references:={csCompilation}) + Dim comp1 = CreateCompilation(source1, options:=TestOptions.DebugDll, targetFramework:=TargetFramework.NetCoreApp, references:={csCompilation, CompilationExtensions.CreateWindowsRuntimeMetadataReference()}) Dim validator = Sub(m As ModuleSymbol) Dim c1 = m.GlobalNamespace.GetTypeMember("C1")