3 types derived from MetadataReference
Microsoft.CodeAnalysis (3)
4407 references to MetadataReference
BuildValidator (4)
ConfigurationSchemaGenerator (1)
ConfigurationSchemaGenerator.Tests (30)
GeneratorTests.cs (30)
44private static readonly ImmutableArray<MetadataReference> s_defaultReferences =
46MetadataReference.CreateFromFile(typeof(Attribute).Assembly.Location),
47MetadataReference.CreateFromFile(typeof(Attribute).Assembly.Location.Replace("System.Private.CoreLib", "System.Runtime")),
48MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location),
49MetadataReference.CreateFromFile(typeof(HttpContent).Assembly.Location)
453ImmutableArray<MetadataReference> references = [
454MetadataReference.CreateFromFile(typeof(Uri).Assembly.Location),
455MetadataReference.CreateFromFile(typeof(X509Certificate2).Assembly.Location)
684ImmutableArray<MetadataReference> references = [
685MetadataReference.CreateFromFile(typeof(TypeConverter).Assembly.Location),
686MetadataReference.CreateFromFile(typeof(TypeConverterAttribute).Assembly.Location),
687MetadataReference.CreateFromFile(typeof(Host).Assembly.Location),
688MetadataReference.CreateFromFile(typeof(IHost).Assembly.Location),
689MetadataReference.CreateFromFile(typeof(IServiceCollection).Assembly.Location),
690MetadataReference.CreateFromFile(typeof(IServiceProvider).Assembly.Location),
691MetadataReference.CreateFromFile(typeof(IConfigurationBuilder).Assembly.Location),
692MetadataReference.CreateFromFile(typeof(ConfigurationManager).Assembly.Location),
693MetadataReference.CreateFromFile(typeof(IOptionsMonitor<>).Assembly.Location),
694MetadataReference.CreateFromFile(typeof(OptionsBuilderConfigurationExtensions).Assembly.Location),
695MetadataReference.CreateFromFile(typeof(BinderOptions).Assembly.Location),
696MetadataReference.CreateFromFile(typeof(Console).Assembly.Location)
754ImmutableArray<MetadataReference> references = [
755MetadataReference.CreateFromFile(typeof(DynamicAttribute).Assembly.Location),
756MetadataReference.CreateFromFile(typeof(JsonNamingPolicy).Assembly.Location)
782ImmutableArray<MetadataReference> references =
784MetadataReference.CreateFromFile(typeof(ConfigurationKeyNameAttribute).Assembly.Location)
822ImmutableArray<MetadataReference> references =
824MetadataReference.CreateFromFile(typeof(ConfigurationKeyNameAttribute).Assembly.Location)
1356ImmutableArray<MetadataReference> references = [
1559private static string GenerateSchemaFromCode(string sourceText, IEnumerable<MetadataReference> references)
IdeCoreBenchmarks (1)
InteractiveHost.UnitTests (4)
Microsoft.Analyzers.Extra.Tests (9)
Microsoft.Analyzers.Local.Tests (5)
Microsoft.AspNetCore.Analyzer.Testing (2)
Microsoft.AspNetCore.Analyzers.Test (5)
Microsoft.AspNetCore.App.Analyzers.Test (3)
Microsoft.AspNetCore.Components.Analyzers.Tests (8)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (8)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
Microsoft.CodeAnalysis (177)
Diagnostic\CommonMessageProvider.cs (4)
210public abstract void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity);
211public abstract void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity);
ReferenceManager\CommonReferenceManager.Binding.cs (16)
96ImmutableArray<MetadataReference> explicitReferences,
103out ImmutableArray<MetadataReference> implicitlyResolvedReferences,
154implicitlyResolvedReferences = ImmutableArray<MetadataReference>.Empty;
212ImmutableArray<MetadataReference> explicitReferences,
220out ImmutableArray<MetadataReference> metadataReferences,
237var metadataReferencesBuilder = ArrayBuilder<MetadataReference>.GetInstance();
239Dictionary<MetadataReference, MergedAliases>? lazyAliasMap = null;
242var referenceBindingsToProcess = ArrayBuilder<(MetadataReference, ArraySegment<AssemblyReferenceBinding>)>.GetInstance();
294var existingReference = TryAddAssembly(resolvedAssemblyIdentity, resolvedReference, index, resolutionDiagnostics, Location.None, assemblyReferencesBySimpleName, supersedeLowerVersions);
323metadataReferences = ImmutableArray<MetadataReference>.Empty;
391ImmutableArray<MetadataReference> explicitReferences,
395[Out] ArrayBuilder<(MetadataReference, ArraySegment<AssemblyReferenceBinding>)> result)
407var moduleReference = explicitReferences[explicitModuleToReferenceMap[moduleIndex]];
461ImmutableArray<MetadataReference> references,
462Dictionary<MetadataReference, MergedAliases>? propertyMapOpt,
525MetadataReference requestingReference,
ReferenceManager\CommonReferenceManager.Resolution.cs (40)
49protected abstract bool CheckPropertiesConsistency(MetadataReference primaryReference, MetadataReference duplicateReference, DiagnosticBag diagnostics);
63private readonly ImmutableArray<MetadataReference> _mergedReferencesOpt;
73_mergedReferencesOpt = default(ImmutableArray<MetadataReference>);
77public ResolvedReference(int index, MetadataImageKind kind, ImmutableArray<string> aliasesOpt, ImmutableArray<string> recursiveAliasesOpt, ImmutableArray<MetadataReference> mergedReferences)
119public ImmutableArray<MetadataReference> MergedReferences
174public readonly MetadataReference? Reference;
185public ReferencedAssemblyIdentity(AssemblyIdentity identity, MetadataReference reference, int relativeAssemblyIndex)
213out ImmutableArray<MetadataReference> references,
214out IDictionary<(string, string), MetadataReference> boundReferenceDirectiveMap,
215out ImmutableArray<MetadataReference> boundReferenceDirectives,
232Dictionary<MetadataReference, MergedAliases>? lazyAliasMap = null;
235var boundReferences = new Dictionary<MetadataReference, MetadataReference>(MetadataReferenceEqualityComparer.Instance);
237ArrayBuilder<MetadataReference>? uniqueDirectiveReferences = (referenceDirectiveLocations != null) ? ArrayBuilder<MetadataReference>.GetInstance() : null;
248var boundReference = references[referenceIndex];
255MetadataReference? existingReference;
402boundReferenceDirectives = ImmutableArray<MetadataReference>.Empty;
439private static ResolvedReference GetResolvedReferenceAndFreePropertyMapEntry(MetadataReference reference, int index, MetadataImageKind kind, Dictionary<MetadataReference, MergedAliases>? propertyMapOpt)
442var mergedReferences = ImmutableArray<MetadataReference>.Empty;
570internal sealed class MetadataReferenceEqualityComparer : IEqualityComparer<MetadataReference>
574public bool Equals(MetadataReference? x, MetadataReference? y)
594public int GetHashCode(MetadataReference reference)
610private void MergeReferenceProperties(MetadataReference primaryReference, MetadataReference newReference, DiagnosticBag diagnostics, ref Dictionary<MetadataReference, MergedAliases>? lazyAliasMap)
619lazyAliasMap = new Dictionary<MetadataReference, MergedAliases>();
663private MetadataReference? TryAddAssembly(
665MetadataReference reference,
791out ImmutableArray<MetadataReference> references,
792out IDictionary<(string, string), MetadataReference> boundReferenceDirectives,
795ArrayBuilder<MetadataReference> referencesBuilder = ArrayBuilder<MetadataReference>.GetInstance();
797IDictionary<(string, string), MetadataReference>? localBoundReferenceDirectives = null;
819MetadataReference? boundReference = ResolveReferenceDirective(referenceDirective.File, referenceDirective.Location, compilation);
828localBoundReferenceDirectives = new Dictionary<(string, string), MetadataReference>();
850localBoundReferenceDirectives = SpecializedCollections.EmptyDictionary<(string, string), MetadataReference>();
ReferenceManager\CommonReferenceManager.State.cs (46)
39internal abstract IEnumerable<KeyValuePair<MetadataReference, IAssemblySymbolInternal>> GetReferencedAssemblies();
46internal abstract MetadataReference? GetMetadataReference(IAssemblySymbolInternal? assemblySymbol);
47internal abstract ImmutableArray<MetadataReference> ExplicitReferences { get; }
72internal readonly Dictionary<MetadataReference, MetadataOrDiagnostic> ObservedMetadata;
91private Dictionary<MetadataReference, int>? _lazyReferencedAssembliesMap;
101private Dictionary<MetadataReference, int>? _lazyReferencedModuleIndexMap;
107private IDictionary<(string, string), MetadataReference>? _lazyReferenceDirectiveMap;
118private ImmutableArray<MetadataReference> _lazyDirectiveReferences;
120private ImmutableArray<MetadataReference> _lazyExplicitReferences;
126/// For each such assembly identity <see cref="MetadataReferenceResolver.ResolveMissingAssembly(MetadataReference, AssemblyIdentity)"/> is called
184/// A map capturing <see cref="MetadataReference"/>s that were "merged" to a single referenced assembly
188private ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>>? _lazyMergedAssemblyReferencesMap;
195public CommonReferenceManager(string simpleAssemblyName, AssemblyIdentityComparer identityComparer, Dictionary<MetadataReference, MetadataOrDiagnostic>? observedMetadata)
202this.ObservedMetadata = observedMetadata ?? new Dictionary<MetadataReference, MetadataOrDiagnostic>();
223internal Dictionary<MetadataReference, int> ReferencedAssembliesMap
232internal Dictionary<MetadataReference, int> ReferencedModuleIndexMap
241internal IDictionary<(string, string), MetadataReference> ReferenceDirectiveMap
250internal ImmutableArray<MetadataReference> DirectiveReferences
268internal override ImmutableArray<MetadataReference> ExplicitReferences
324internal ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>> MergedAssemblyReferencesMap
409Dictionary<MetadataReference, int> referencedAssembliesMap,
410Dictionary<MetadataReference, int> referencedModulesMap,
411IDictionary<(string, string), MetadataReference> boundReferenceDirectiveMap,
412ImmutableArray<MetadataReference> directiveReferences,
413ImmutableArray<MetadataReference> explicitReferences,
423Dictionary<MetadataReference, ImmutableArray<MetadataReference>>? mergedAssemblyReferencesMapOpt)
444_lazyMergedAssemblyReferencesMap = mergedAssemblyReferencesMapOpt?.ToImmutableDictionary() ?? ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>>.Empty;
461ImmutableArray<MetadataReference> references,
467out Dictionary<MetadataReference, int> referencedAssembliesMap,
468out Dictionary<MetadataReference, int> referencedModulesMap,
470out Dictionary<MetadataReference, ImmutableArray<MetadataReference>>? mergedAssemblyReferencesMapOpt)
472referencedAssembliesMap = new Dictionary<MetadataReference, int>(referenceMap.Length);
473referencedModulesMap = new Dictionary<MetadataReference, int>(referencedModuleCount);
498MetadataReference reference = references[i];
504(mergedAssemblyReferencesMapOpt ??= new Dictionary<MetadataReference, ImmutableArray<MetadataReference>>()).Add(reference, referenceMap[i].MergedReferences);
680internal sealed override IEnumerable<KeyValuePair<MetadataReference, IAssemblySymbolInternal>> GetReferencedAssemblies()
685internal TAssemblySymbol? GetReferencedAssemblySymbol(MetadataReference reference)
691internal int GetReferencedModuleIndex(MetadataReference reference)
698/// Gets the <see cref="MetadataReference"/> that corresponds to the assembly symbol.
700internal override MetadataReference? GetMetadataReference(IAssemblySymbolInternal? assemblySymbol)
Microsoft.CodeAnalysis.CSharp (50)
Errors\MessageProvider.cs (4)
205public override void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
212public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
Symbols\ReferenceManager.cs (10)
58public ReferenceManager(string simpleAssemblyName, AssemblyIdentityComparer identityComparer, Dictionary<MetadataReference, MetadataOrDiagnostic>? observedMetadata)
103protected override bool CheckPropertiesConsistency(MetadataReference primaryReference, MetadataReference duplicateReference, DiagnosticBag diagnostics)
351IDictionary<(string, string), MetadataReference>? boundReferenceDirectiveMap;
352ImmutableArray<MetadataReference> boundReferenceDirectives;
355ImmutableArray<MetadataReference> explicitReferences;
373ImmutableArray<MetadataReference> implicitlyResolvedReferences;
404Dictionary<MetadataReference, int> referencedAssembliesMap, referencedModulesMap;
406Dictionary<MetadataReference, ImmutableArray<MetadataReference>>? mergedAssemblyReferencesMapOpt;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (9)
CommandLineTestBase.cs (2)
55internal MockCSharpCompiler CreateCSharpCompiler(string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null, MetadataReference[]? additionalReferences = null)
60internal MockCSharpCompiler CreateCSharpCompiler(string? responseFile, string workingDirectory, string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null, MetadataReference[]? additionalReferences = null)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (261)
CodeGen\CodeGenDynamicTests.cs (24)
31MetadataReference[] references = null,
129private MetadataReference MakeCSharpRuntime(string excludeBinder = null, bool excludeBinderFlags = false, bool excludeArgumentInfoFlags = false, MetadataReference systemCore = null)
233var csrtRef = MakeCSharpRuntime(excludeBinder: "InvokeConstructor");
256var csrtRef = MakeCSharpRuntime(excludeBinderFlags: true, excludeArgumentInfoFlags: true);
277var systemCoreRef = CreateCompilationWithMscorlib40(SystemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference();
278var csrtRef = MakeCSharpRuntime(systemCore: systemCoreRef);
296var systemCoreRef = CreateCompilationWithMscorlib40(SystemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference();
297var csrtRef = MakeCSharpRuntime(systemCore: systemCoreRef);
298var funcRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Invalid.InvalidFuncDelegateName.AsImmutableOrNull());
317var systemCoreRef = CreateCompilationWithMscorlib40(SystemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference();
318var csrtRef = MakeCSharpRuntime(systemCore: systemCoreRef);
456var systemCoreRef = CreateCompilationWithMscorlib40(systemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference();
457var csrtRef = MakeCSharpRuntime(systemCore: systemCoreRef);
485var systemCoreRef = CreateCompilationWithMscorlib40(systemCoreSource, assemblyName: GetUniqueName()).EmitToImageReference();
486var csrtRef = MakeCSharpRuntime(systemCore: systemCoreRef);
11468var vbRef = vb.EmitToImageReference();
11486CompileAndVerifyIL(source, "C.M", references: new MetadataReference[] { SystemCoreRef, CSharpRef, vbRef }, expectedOptimizedIL: @"
11570var vbRef = vb.EmitToImageReference();
11588CompileAndVerifyIL(source, "C.M", references: new MetadataReference[] { SystemCoreRef, CSharpRef, vbRef }, expectedOptimizedIL: @"
11679var vbRef = vb.EmitToImageReference();
11697CompileAndVerifyIL(source, "C.M", references: new MetadataReference[] { SystemCoreRef, CSharpRef, vbRef }, expectedOptimizedIL: @"
11849var ilRef = MetadataReference.CreateFromImage(TestResources.MetadataTests.Interop.IndexerWithByRefParam.AsImmutableOrNull());
11871CompileAndVerifyIL(source, "C.M", references: new MetadataReference[] { SystemCoreRef, CSharpRef, ilRef }, expectedOptimizedIL: @"
CodeGen\CodeGenOverridingAndHiding.cs (9)
2827var refs = new System.Collections.Generic.List<MetadataReference>() { asm01, asm02 };
2920var refs = new System.Collections.Generic.List<MetadataReference>() { asm01, asm02 };
2989references: new MetadataReference[] { asm01, asm02, new CSharpCompilationReference(comp1) },
3158var refs = new System.Collections.Generic.List<MetadataReference>() { asm01, asm02 };
3373references: new MetadataReference[] { asm01, asm02 },
3378references: new MetadataReference[] { asm01, asm02, new CSharpCompilationReference(comp1) },
3383references: new MetadataReference[] { asm01, asm02, new CSharpCompilationReference(comp1), new CSharpCompilationReference(comp2) },
3487references: new MetadataReference[] { asmfile, new CSharpCompilationReference(comp1), new CSharpCompilationReference(comp2) },
4016var references = new MetadataReference[] { TestReferences.SymbolsTests.Methods.ILMethods };
Emit\CompilationEmitTests.cs (74)
235CSharpCompilation compUsing = CreateCompilation(srcUsing, new[] { MetadataReference.CreateFromImage(mdOnlyImage.AsImmutableOrNull()) });
1033var piaImageReference = pia.EmitToImageReference(embedInteropTypes: true);
1041void verifyRefOnly(MetadataReference reference)
1044references: new MetadataReference[] { reference });
1049void verifyRefOut(MetadataReference reference)
1052references: new MetadataReference[] { reference });
1060var reference = CompilationVerifier.LoadTestEmittedExecutableForSymbolValidation(image, OutputKind.DynamicallyLinkedLibrary);
1112var piaImageReference = pia.EmitToImageReference(embedInteropTypes: true);
1120void verifyRefOnly(MetadataReference reference)
1123references: new MetadataReference[] { reference });
1128void verifyRefOut(MetadataReference reference)
1131references: new MetadataReference[] { reference });
1142var reference = CompilationVerifier.LoadTestEmittedExecutableForSymbolValidation(image, OutputKind.DynamicallyLinkedLibrary);
1808var image1 = comp1.EmitToImageReference(EmitOptions.Default);
1816var image2 = comp2.EmitToImageReference(EmitOptions.Default.WithEmitMetadataOnly(true).WithIncludePrivateMembers(false));
1890var libImage = libComp.EmitToImageReference(emitOptions);
2131var realImage = comp.EmitToImageReference(EmitOptions.Default);
2162var realImage2 = comp.EmitToImageReference(emitRegularWithoutPrivateMembers);
2190var metadataImage = comp.EmitToImageReference(emitMetadataOnly);
2219var refImage = comp.EmitToImageReference(emitRefOnly);
2268var realImage = comp.EmitToImageReference(EmitOptions.Default);
2278var metadataImage = comp.EmitToImageReference(emitMetadataOnly);
2290var refImage = comp.EmitToImageReference(emitRefOnly);
2335var realImage = comp.EmitToImageReference(EmitOptions.Default);
2345var metadataImage = comp.EmitToImageReference(emitMetadataOnly);
2357var refImage = comp.EmitToImageReference(emitRefOnly);
2402var realImage = comp.EmitToImageReference(EmitOptions.Default);
2412var metadataImage = comp.EmitToImageReference(emitMetadataOnly);
2424var refImage = comp.EmitToImageReference(emitRefOnly);
2463var refImage = comp.EmitToImageReference(emitRefOnly);
2508var refImage = comp.EmitToImageReference(emitRefOnly);
2698references: new MetadataReference[] { ilAssemblyReference },
2740var libAssemblyReference = MetadataReference.CreateFromImage(dllImage.AsImmutableOrNull());
2756references: new MetadataReference[] { ilAssemblyReference, libAssemblyReference },
4611CompileAndVerify(p2, new[] { MetadataReference.CreateFromStream(c1.EmitToStream()) }, expectedOutput: "0");
4682var imageRef = refCompilation.EmitToImageReference();
4691new MetadataReference[] { compRef },
4697new MetadataReference[] { imageRef },
4703new MetadataReference[] { compRef },
4709new MetadataReference[] { imageRef },
4715new MetadataReference[] { compRef },
4723new MetadataReference[] { imageRef },
4731new MetadataReference[] { compRef },
4739new MetadataReference[] { imageRef },
4766var imageRef = refCompilation.EmitToImageReference();
4775new MetadataReference[] { imageRef },
4783new MetadataReference[] { imageRef },
4791new MetadataReference[] { imageRef },
4812var imageRef = refCompilation.EmitToImageReference();
4822new MetadataReference[] { compRef },
4830new MetadataReference[] { imageRef },
4838new MetadataReference[] { compRef },
4846new MetadataReference[] { imageRef },
4867var imageRef = refCompilation.EmitToImageReference();
4877new MetadataReference[] { imageRef },
4899var imageRef = refCompilation.EmitToImageReference();
4909new MetadataReference[] { compRef },
4915new MetadataReference[] { imageRef },
4921new MetadataReference[] { compRef },
4927new MetadataReference[] { imageRef },
4946var imageRef = refCompilation.EmitToImageReference();
4956new MetadataReference[] { imageRef },
4976var imageRef = refCompilation.EmitToImageReference();
4986new MetadataReference[] { compRef },
4992new MetadataReference[] { imageRef },
4998new MetadataReference[] { compRef },
5004new MetadataReference[] { imageRef },
5024var imageRef = refCompilation.EmitToImageReference();
5034new MetadataReference[] { imageRef },
5264var ref1 = comp1.EmitToImageReference();
5268var ref2 = comp2.EmitToImageReference();
5311var ref1 = comp1.EmitToImageReference();
5315var ref2 = comp2.EmitToImageReference();
5549var modRef = CreateCompilation("public class A { }", options: TestOptions.ReleaseModule, assemblyName: "refMod").EmitToImageReference();
Emit\InAttributeModifierTests.cs (30)
243var reference = CompileIL(ilSource, prependDefaultHeader: false);
297var reference = CompileIL(ilSource, prependDefaultHeader: false);
353var reference = CompileIL(ilSource, prependDefaultHeader: false);
405var reference = CompileIL(ilSource, prependDefaultHeader: false);
466var reference = CompileIL(ilSource, prependDefaultHeader: false);
515var reference = CompileIL(ilSource, prependDefaultHeader: false);
567var reference = CompileIL(ilSource, prependDefaultHeader: false);
621var reference = CompileIL(ilSource, prependDefaultHeader: false);
678var reference = CompileIL(ilSource, prependDefaultHeader: false);
737var reference = CompileIL(ilSource, prependDefaultHeader: false);
807var reference = CompileIL(ilSource, prependDefaultHeader: false);
887var reference = CompileIL(ilSource, prependDefaultHeader: false);
954var reference = CompileIL(ilSource, prependDefaultHeader: false);
1012var reference = CompileIL(ilSource, prependDefaultHeader: false);
1072var reference = CompileIL(ilSource, prependDefaultHeader: false);
1129var reference = CompileIL(ilSource, prependDefaultHeader: false);
1188var reference = CompileIL(ilSource, prependDefaultHeader: false);
1258var reference = CompileIL(ilSource, prependDefaultHeader: false);
1338var reference = CompileIL(ilSource, prependDefaultHeader: false);
1406var reference = CompileIL(ilSource, prependDefaultHeader: false);
1464var reference = CompileIL(ilSource, prependDefaultHeader: false);
3919var reference = CompileIL(ilSource, prependDefaultHeader: false);
3981var reference = CompileIL(ilSource, prependDefaultHeader: false);
4056var reference = CompileIL(ilSource, prependDefaultHeader: false);
4142var reference = CompileIL(ilSource, prependDefaultHeader: false);
4414var ref1 = CreateCompilation(refCode).EmitToImageReference();
4415var ref2 = CreateCompilation(refCode).EmitToImageReference();
4457var corlibWithoutInAttributeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference();
4465var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference();
4466var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutInAttributeRef }).EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (74)
Emit\UnmanagedTypeModifierTests.cs (16)
59var reference = CompileIL(ilSource, prependDefaultHeader: false);
128var reference = CompileIL(ilSource, prependDefaultHeader: false);
197var reference = CompileIL(ilSource, prependDefaultHeader: false);
264var reference = CompileIL(ilSource, prependDefaultHeader: false);
331var reference = CompileIL(ilSource, prependDefaultHeader: false);
391var reference = CompileIL(ilSource, prependDefaultHeader: false);
1108var ref1 = CreateCompilation(refCode).EmitToImageReference();
1109var ref2 = CreateCompilation(refCode).EmitToImageReference();
1143var corlibWithoutUnmanagedTypeRef = CreateEmptyCompilation(corlib_cs).EmitToImageReference();
1151var ref1 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference();
1152var ref2 = CreateEmptyCompilation(refCode, references: new[] { corlibWithoutUnmanagedTypeRef }).EmitToImageReference();
1197var reference = CompileIL(ilSource, prependDefaultHeader: false);
1253var reference = CompileIL(ilSource, prependDefaultHeader: false);
1311var reference = CompileIL(ilSource, prependDefaultHeader: false);
1366var reference = CompileIL(ilSource, prependDefaultHeader: false);
1421var reference = CompileIL(ilSource, prependDefaultHeader: false);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (519)
Attributes\AttributeTests_Assembly.cs (36)
412", new MetadataReference[] { deRef, neutralRef }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "10");
422compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "20");
444", new MetadataReference[] { en_usRef }, options: TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "23");
451compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "25");
463", new MetadataReference[] { deRef, neutralRef }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "30");
470compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "40");
495", new MetadataReference[] { deRef }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "50");
505compilation = CreateCompilationWithMscorlib40("", new MetadataReference[] { compilation.EmitToImageReference() }, TestOptions.ReleaseDll, assemblyName: assemblyNameBase + "60");
1004private MetadataReference GetNetModuleWithAssemblyAttributesRef(string source = null, IEnumerable<MetadataReference> references = null)
1010private ModuleMetadata GetNetModuleWithAssemblyAttributes(string source = null, IEnumerable<MetadataReference> references = null, string assemblyName = null)
1418var netmodule1Ref = GetNetModuleWithAssemblyAttributesRef();
1434var netmodule2Ref = compilation.EmitToImageReference();
1521MetadataReference netmodule1Ref = GetNetModuleWithAssemblyAttributesRef(source2, references: new[] { defsRef });
1532MetadataReference netmodule2Ref = GetNetModuleWithAssemblyAttributesRef(source1, references: new[] { defsRef });
1569MetadataReference netmoduleRef = GetNetModuleWithAssemblyAttributesRef(s_defaultNetModuleSourceHeader + netmoduleAttributes + s_defaultNetModuleSourceBody);
1618MetadataReference netmoduleDefsRef = GetNetModuleWithAssemblyAttributesRef(defaultBodyString + s_defaultNetModuleSourceBody);
1619MetadataReference netmodule0Ref = GetNetModuleWithAssemblyAttributesRef(s_defaultNetModuleSourceHeader, references: new[] { netmoduleDefsRef });
1620MetadataReference netmodule1Ref = GetNetModuleWithAssemblyAttributesRef(netmodule1Attributes, references: new[] { netmoduleDefsRef });
1621MetadataReference netmodule2Ref = GetNetModuleWithAssemblyAttributesRef(netmodule2Attributes, references: new[] { netmoduleDefsRef });
1622MetadataReference netmodule3Ref = GetNetModuleWithAssemblyAttributesRef(netmodule3Attributes, references: new[] { netmoduleDefsRef });
1648MetadataReference netmoduleRef = GetNetModuleWithAssemblyAttributesRef(s_defaultNetModuleSourceHeader + netmoduleAttributes + s_defaultNetModuleSourceBody);
1690MetadataReference netmoduleRef = GetNetModuleWithAssemblyAttributesRef(s_defaultNetModuleSourceHeader + netmoduleAttributes + s_defaultNetModuleSourceBody);
1743var netModuleRef = GetNetModuleWithAssemblyAttributesRef(mod, new[] { Net40.References.SystemCore });
1783var netModuleRef = GetNetModuleWithAssemblyAttributesRef(mod, new[] { SystemCoreRef });
2120references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() },
2152references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() },
2182references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() },
2214references: new MetadataReference[] { compMod1.EmitToImageReference(), compMod2.EmitToImageReference() },
2239references: new MetadataReference[] { compMod1.EmitToImageReference() },
2286var attributeDefinition1 = CreateCompilation(attribute1, options: TestOptions.ReleaseDll, assemblyName: "A1").EmitToImageReference();
2291var moduleWithAttribute = CreateCompilation(module, references: new[] { attributeDefinition1 }, options: TestOptions.ReleaseModule, assemblyName: "M1").EmitToImageReference();
2318var attributeDefinition2 = CreateCompilation(attribute2, options: TestOptions.ReleaseDll, assemblyName: "A1").EmitToImageReference();
2337var c1Definition = CreateCompilation(c1, options: TestOptions.ReleaseDll, assemblyName: "A1").EmitToImageReference();
2347var module1WithAttribute = CreateCompilation(module1, references: new[] { c1Definition }, options: TestOptions.ReleaseModule, assemblyName: "M1").EmitToImageReference();
2376var module2WithAttribute = CreateCompilation(module2, references: new[] { c1Definition }, options: TestOptions.ReleaseModule, assemblyName: "M1").EmitToImageReference();
Attributes\AttributeTests_CallerInfoAttributes.cs (23)
22public static IEnumerable<MetadataReference> GetReferencesWithoutInteropServices() =>
681var ref1 = comp1.EmitToImageReference();
1567var ref1 = comp1.EmitToImageReference();
2677var compilation = CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef }, TestOptions.ReleaseExe);
2711var compilation = CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef }, TestOptions.ReleaseExe);
2785CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }).VerifyDiagnostics(
3169MetadataReference libReference = CompileIL(iLSource);
3428var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
3454var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef });
3563var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
3606var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
4134var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
4379var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
4401var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
4431var compilation = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef }, options: TestOptions.ReleaseExe);
4483MetadataReference libReference = CompileIL(iLSource);
4632MetadataReference libReference = CompileIL(iLSource);
5384var compilation = CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef }, TestOptions.ReleaseExe);
5420var compilation = CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef }, TestOptions.ReleaseExe);
5456var compilation = CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef }, TestOptions.ReleaseExe);
5495var compilation = CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef }, TestOptions.ReleaseExe);
5651var vbReference = BasicCompilationUtils.CompileToMetadata(vbSource, references: new[] { MscorlibRef_v4_0_30316_17626, SystemCoreRef });
5741var vbReference = BasicCompilationUtils.CompileToMetadata(vbSource, references: new[] { MscorlibRef_v4_0_30316_17626, SystemCoreRef });
Attributes\InternalsVisibleToAndStrongNameTests.cs (19)
883new[] { MetadataReference.CreateFromStream(otherStream) },
916new MetadataReference[] { new CSharpCompilationReference(other) },
1070references: new[] { MetadataReference.CreateFromImage(other.EmitToArray()) },
1194new MetadataReference[] { new CSharpCompilationReference(other) },
1229new MetadataReference[] { new CSharpCompilationReference(other) },
1269new MetadataReference[] { new CSharpCompilationReference(other) },
1301new MetadataReference[] { new CSharpCompilationReference(other) },
1337new MetadataReference[] { new CSharpCompilationReference(other) },
1382new MetadataReference[] { new CSharpCompilationReference(giver) },
1604var reference = other.EmitToImageReference();
1628var reference = other.EmitToImageReference();
2025var ilRef = CompileIL(il, prependDefaultHeader: false);
2375var ref2 = CompileIL(source2, prependDefaultHeader: false);
2417CompileAndVerify(other.WithReferences(new[] { other.References.ElementAt(0), MetadataReference.CreateFromStream(unsigned.EmitToStream()) })).VerifyDiagnostics();
2444other.WithReferences(new []{other.References.ElementAt(0), MetadataReference.CreateFromStream(unsigned.EmitToStream()) })};
2897var libRef = CreateCompilation(lib_cs, options: TestOptions.SigningReleaseDll, parseOptions: parseOptions).EmitToImageReference();
2934var libRef = CreateCompilation(lib_cs, options: TestOptions.SigningReleaseDll).EmitToImageReference();
3070MetadataReference imageReference = lib.EmitToImageReference();
3194MetadataReference imageReference = lib.EmitToImageReference();
FlowAnalysis\FlowTestBase.cs (8)
87protected DataFlowAnalysis CompileAndAnalyzeDataFlowExpression(string program, params MetadataReference[] references)
92protected DataFlowAnalysis CompileAndAnalyzeDataFlowExpression(string program, TargetFramework targetFramework, params MetadataReference[] references)
97protected DataFlowAnalysis CompileAndAnalyzeDataFlowConstructorInitializer(string program, params MetadataReference[] references)
102protected DataFlowAnalysis CompileAndAnalyzeDataFlowPrimaryConstructorInitializer(string program, params MetadataReference[] references)
117protected T CompileAndGetModelAndConstructorInitializer<T>(string program, Func<SemanticModel, ConstructorInitializerSyntax, T> analysisDelegate, params MetadataReference[] references)
138protected T CompileAndGetModelAndPrimaryConstructorInitializer<T>(string program, Func<SemanticModel, PrimaryConstructorBaseTypeSyntax, T> analysisDelegate, params MetadataReference[] references)
159protected T CompileAndGetModelAndExpression<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, params MetadataReference[] references)
164protected T CompileAndGetModelAndExpression<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, TargetFramework targetFramework, bool assertNoDiagnostics, params MetadataReference[] references)
FlowAnalysis\StructTests.cs (27)
545var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream());
561references: new MetadataReference[] { sourceReference }).VerifyDiagnostics(
571references: new MetadataReference[] { metadataReference }).VerifyDiagnostics(
581references: new MetadataReference[] { sourceReference }).VerifyDiagnostics(
588references: new MetadataReference[] { metadataReference }).VerifyDiagnostics(
605var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream());
616CreateCompilation(source2, references: new MetadataReference[] { sourceReference }).VerifyDiagnostics(
621CreateCompilation(source2, references: new MetadataReference[] { metadataReference }).VerifyDiagnostics(
638var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream());
649CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
651CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
653CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
658CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
683var metadataReference = MetadataReference.CreateFromStream(comp1.EmitToStream());
694CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
696CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
698CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
703CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
727var moduleReference = comp1.EmitToImageReference();
738CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
743CreateCompilation(source2, references: new MetadataReference[] { moduleReference }).VerifyDiagnostics(
770var moduleReference = comp1.EmitToImageReference();
781CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: WithNullableEnable()).VerifyDiagnostics(
786CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: WithNullableEnable().WithWarningLevel(5)).VerifyDiagnostics(
803var moduleReference = comp1.EmitToImageReference();
814CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
816CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
RefStructInterfacesTests.cs (52)
645MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
660foreach (var comp1Ref in comp1Refs)
684foreach (var comp1Ref in comp1Refs)
726foreach (var comp1Ref in comp1Refs)
752foreach (var comp1Ref in comp1Refs)
773foreach (var comp1Ref in comp1Refs)
799foreach (var comp1Ref in comp1Refs)
833foreach (var comp1Ref in comp1Refs)
862foreach (var comp1Ref in comp1Refs)
883foreach (var comp1Ref in comp1Refs)
906foreach (var comp1Ref in comp1Refs)
928foreach (var comp1Ref in comp1Refs)
949MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
966foreach (var comp1Ref in comp1Refs)
993foreach (var comp1Ref in comp1Refs)
1063MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
1084foreach (var comp1Ref in comp1Refs)
1141foreach (var comp1Ref in comp1Refs)
1214foreach (var comp1Ref in comp1Refs)
1253foreach (var comp1Ref in comp1Refs)
1302foreach (var comp1Ref in comp1Refs)
1339foreach (var comp1Ref in comp1Refs)
1392foreach (var comp1Ref in comp1Refs)
1449foreach (var comp1Ref in comp1Refs)
1469foreach (var comp1Ref in comp1Refs)
1494foreach (var comp1Ref in comp1Refs)
1516foreach (var comp1Ref in comp1Refs)
1544MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
1566foreach (var comp1Ref in comp1Refs)
1600foreach (var comp1Ref in comp1Refs)
1639MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
1660foreach (var comp1Ref in comp1Refs)
1717foreach (var comp1Ref in comp1Refs)
1790foreach (var comp1Ref in comp1Refs)
1829foreach (var comp1Ref in comp1Refs)
1878foreach (var comp1Ref in comp1Refs)
1915foreach (var comp1Ref in comp1Refs)
1968foreach (var comp1Ref in comp1Refs)
2025foreach (var comp1Ref in comp1Refs)
2045foreach (var comp1Ref in comp1Refs)
2070foreach (var comp1Ref in comp1Refs)
2092foreach (var comp1Ref in comp1Refs)
2120MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()];
2142foreach (var comp1Ref in comp1Refs)
2176foreach (var comp1Ref in comp1Refs)
2722var refA = AsReference(comp, useCompilationReference);
2758var refA = AsReference(comp, useCompilationReference);
2797var refA = AsReference(comp, useCompilationReference);
2833var refA = AsReference(comp, useCompilationReference);
2867var refA = AsReference(comp, useCompilationReference);
2904var refA = AsReference(comp, useCompilationReference);
22397var refA = CompileIL(sourceA);
Semantics\CollectionExpressionTests.cs (77)
4689var refA = AsReference(comp, useCompilationReference);
9199var refA = comp.EmitToImageReference();
9221var refB = comp.EmitToImageReference();
12185var refA = comp.EmitToImageReference();
12197var refB = comp.EmitToImageReference();
13703var reference = CreateEmptyCompilation(runtime, assemblyName: "System.Runtime").VerifyDiagnostics().EmitToImageReference();
15181var refA = AsReference(comp, useCompilationReference);
15372var refA = AsReference(comp, useCompilationReference);
15589var refA = comp.EmitToImageReference();
15680var refA = AsReference(comp, useCompilationReference);
15768var refA = AsReference(comp, useCompilationReference);
15817var refA = AsReference(comp, useCompilationReference);
15866var refA = AsReference(comp, useCompilationReference);
15915var refA = AsReference(comp, useCompilationReference);
15955var refA = AsReference(comp, useCompilationReference);
16017var refA = AsReference(comp, useCompilationReference);
16082var refA = AsReference(comp, useCompilationReference);
16131var refA = AsReference(comp, useCompilationReference);
16173var refA = AsReference(comp, useCompilationReference);
16227var refA = AsReference(comp, useCompilationReference);
16346var refA = AsReference(comp, useCompilationReference);
16378var refA = comp.EmitToImageReference();
16392var refB = comp.EmitToImageReference();
16435var refA = AsReference(comp, useCompilationReference);
16483var refA = CompileIL(sourceA);
16562var refA = CompileIL(sourceA);
16655var refA = CompileIL(sourceA);
16871var refA = CompileIL(sourceA);
16916var refA = AsReference(comp, useCompilationReference);
16965var refA = AsReference(comp, useCompilationReference);
17019var refA = AsReference(comp, useCompilationReference);
17086var refA = AsReference(comp, useCompilationReference);
17151var refA = AsReference(comp, useCompilationReference);
17340var refA = AsReference(comp, useCompilationReference);
17389var refA = AsReference(comp, useCompilationReference);
17438var refA = AsReference(comp, useCompilationReference);
17484var refA = AsReference(comp, useCompilationReference);
17530var refA = AsReference(comp, useCompilationReference);
17573var refA = AsReference(comp, useCompilationReference);
17621var refA = AsReference(comp, useCompilationReference);
17666var refA = AsReference(comp, useCompilationReference);
17712var refA = AsReference(comp, useCompilationReference);
17815var refA = AsReference(comp, useCompilationReference);
17867var refA = AsReference(comp, useCompilationReference);
17927var refA = AsReference(comp, useCompilationReference);
17972var refA = AsReference(comp, useCompilationReference);
18017var refA = AsReference(comp, useCompilationReference);
18075var refA = AsReference(comp, useCompilationReference);
18119var refA = AsReference(comp, useCompilationReference);
18852var refA = AsReference(comp, useCompilationReference);
18943var refA = AsReference(comp, useCompilationReference);
18989var refA = AsReference(comp, useCompilationReference);
19086var refA = AsReference(comp, useCompilationReference);
19149var refA = AsReference(comp, useCompilationReference);
19253var refA = AsReference(comp, useCompilationReference);
19522var refA = AsReference(comp, useCompilationReference);
19606var refA = AsReference(comp, useCompilationReference);
19698var refA = AsReference(comp, useCompilationReference);
19761var refA = CompileIL(sourceA);
19818var refA = CompileIL(sourceA);
19858var refA = comp.EmitToImageReference();
19873var refB = comp.EmitToImageReference();
22562var refA = comp.EmitToImageReference();
22701var refA = AsReference(comp, useCompilationReference);
25651var refA = comp.EmitToImageReference();
38821var refA1 = comp.EmitToImageReference();
38835var refB = comp.EmitToImageReference();
38844var refA2 = comp.EmitToImageReference();
40072var refA = comp.EmitToImageReference();
40610var refA = comp.EmitToImageReference();
41900var refA = comp.EmitToImageReference();
41914var refB = comp.EmitToImageReference();
41961var refA = comp.EmitToImageReference();
41975var refB = comp.EmitToImageReference();
42707var comp1Ref = comp1.EmitToImageReference();
42787var comp1Ref = comp1.EmitToImageReference();
42870var myCollectionRef = myCollection.EmitToImageReference();
Semantics\PatternMatchingTests_ListPatterns.cs (7)
3256var missingRef = CreateCompilation(missing_cs, assemblyName: "missing")
3267var lib2Ref = CreateCompilation(lib2_cs, references: new[] { missingRef })
3351var missingRef = CreateCompilation(missing_cs, assemblyName: "missing")
3365var lib2Ref = CreateCompilation(new[] { lib2_cs, TestSources.Index, TestSources.Range }, references: new[] { missingRef })
3433var rangeRef = rangeComp.EmitToImageReference();
5347var missingRef = CreateCompilation(missing_cs, assemblyName: "missing")
5359var lib2Ref = CreateCompilation(new[] { lib2_cs, TestSources.Index, TestSources.Range }, references: new[] { missingRef })
Semantics\RecordTests.cs (40)
30IEnumerable<MetadataReference>? references = null)
4205var comp1Ref = CreateCompilation(source1).EmitToImageReference();
4211var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4236var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, assemblyName: "Clone_12", parseOptions: TestOptions.Regular9).EmitToImageReference();
4242var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4271var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4277var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, assemblyName: "Clone_13", references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4283var comp3Ref = CreateCompilation(new[] { source3, IsExternalInitTypeDefinition }, references: new[] { comp1Ref, comp2Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4335var comp1Ref = CreateCompilation(source1).EmitToImageReference();
4341var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4366var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, assemblyName: "Clone_15", parseOptions: TestOptions.Regular9).EmitToImageReference();
4372var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4428var comp1Ref = CreateCompilation(new[] { source1, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4434var comp2Ref = CreateCompilation(new[] { source2, IsExternalInitTypeDefinition }, assemblyName: "Clone_16", references: new[] { comp1Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
4440var comp3Ref = CreateCompilation(new[] { source3, IsExternalInitTypeDefinition }, references: new[] { comp1Ref, comp2Ref }, parseOptions: TestOptions.Regular9).EmitToImageReference();
9801var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference();
10571var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference();
10825var refA = comp.EmitToImageReference();
10873var refA = comp.EmitToImageReference();
10951var refA = compA.EmitToImageReference();
11023var refA = compA.EmitToImageReference();
11113var refA = compA.EmitToImageReference();
12190var refA = CompileIL(sourceA);
12265var refA = CompileIL(sourceA);
12344var refA = CompileIL(sourceA);
12449var refA = CompileIL(sourceA);
12572var refA = CompileIL(sourceA);
12615var refA = useCompilationReference ? compA.ToMetadataReference() : compA.EmitToImageReference();
13341var refA = compA.EmitToImageReference();
16283var ref0 = comp.EmitToImageReference();
17232var ref0 = comp.EmitToImageReference();
17328var ref0 = comp.EmitToImageReference();
17424var ref0 = comp.EmitToImageReference();
23800var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference();
24276var ref0 = comp.EmitToImageReference();
24341var ref0 = comp.EmitToImageReference();
24411var ref0 = comp.EmitToImageReference();
24490var ref0 = comp.EmitToImageReference();
26086var compRef = CreateCompilation(src).EmitToImageReference();
30188var refA = useCompilationReference ? compA.ToMetadataReference() : compA.EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.Features (3)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (9)
IOperation\IOperationTests_IArgument.cs (3)
2091var ilReference = VerifyOperationTreeAndDiagnosticsForTestWithIL<ElementAccessExpressionSyntax>(csharp, il, expectedOperationTree, expectedDiagnostics, additionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
2210var ilReference = VerifyOperationTreeAndDiagnosticsForTestWithIL<ElementAccessExpressionSyntax>(csharp, il, expectedOperationTree, expectedDiagnostics, additionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
2330var ilReference = VerifyOperationTreeAndDiagnosticsForTestWithIL<ElementAccessExpressionSyntax>(csharp, il, expectedOperationTree, expectedDiagnostics, additionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (18)
InteractiveSessionReferencesTests.cs (17)
463var badTypeRef = MetadataReference.CreateFromImage(badTypeBytes.AsImmutableOrNull());
610", new MetadataReference[] { NetFramework.mscorlib, libBase.ToMetadataReference() }, lib1Name);
617", new MetadataReference[] { NetFramework.mscorlib, libBase.ToMetadataReference() }, lib2Name);
668", new MetadataReference[] { NetFramework.mscorlib, libBase.ToMetadataReference() }, lib1Name);
675", new MetadataReference[] { NetFramework.mscorlib, libBase.ToMetadataReference() }, lib2Name);
733", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib1Name);
740", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib2Name);
801", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib1Name);
808", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib2Name);
869", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib1Name);
876", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib2Name);
937", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib1Name);
944", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib2Name);
1005", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib1Name);
1012", new MetadataReference[] { NetFramework.mscorlib, libBase2.ToMetadataReference() }, lib2Name);
1073", new MetadataReference[] { NetFramework.mscorlib, libBase1.ToMetadataReference() }, lib1Name);
1080", new MetadataReference[] { NetFramework.mscorlib, libBase2.ToMetadataReference() }, lib2Name);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (572)
Semantics\BindingAsyncTests.cs (21)
412CreateCompilationWithMscorlib461(source, new MetadataReference[] { LinqAssemblyRef, SystemRef }).VerifyDiagnostics(
449CreateCompilationWithMscorlib461(source, new MetadataReference[] { LinqAssemblyRef, SystemRef }).VerifyDiagnostics();
479CreateCompilationWithMscorlib461(source, new MetadataReference[] { LinqAssemblyRef, SystemRef }).VerifyDiagnostics(
512CreateCompilationWithMscorlib461(source, new MetadataReference[] { LinqAssemblyRef, SystemRef }).VerifyDiagnostics(
546CreateCompilationWithMscorlib461(source, new MetadataReference[] { LinqAssemblyRef, SystemRef }).VerifyDiagnostics(
580CreateCompilationWithMscorlib461(source, new MetadataReference[] { LinqAssemblyRef, SystemRef }).VerifyDiagnostics(
1342CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef, LinqAssemblyRef }).VerifyDiagnostics();
1371CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef, LinqAssemblyRef }).VerifyDiagnostics();
1399CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef, LinqAssemblyRef }).VerifyDiagnostics(
1431CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef, LinqAssemblyRef }).VerifyDiagnostics(
1466CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef, LinqAssemblyRef }).VerifyDiagnostics(
1504new MetadataReference[] { SystemRef, LinqAssemblyRef },
1545new MetadataReference[] { SystemRef, LinqAssemblyRef },
1577CreateCompilationWithMscorlib461(source, new MetadataReference[] { SystemRef, LinqAssemblyRef }).VerifyDiagnostics(
1742CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics(
1902CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics(
1957CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics(
2343CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics(
2532CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics(
2890CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics(
3947var reference = CompileIL(ilSource);
Semantics\BindingTests.cs (22)
778", assemblyName: "DerivedAssembly1", references: new List<MetadataReference>() { baseAssembly.EmitToImageReference() }).VerifyDiagnostics();
791", references: new List<MetadataReference>() { derivedAssembly.EmitToImageReference() })
817", assemblyName: "DerivedAssembly2", references: new List<MetadataReference>() { baseAssembly.EmitToImageReference() }).VerifyDiagnostics();
830", references: new List<MetadataReference>() { derivedAssembly.EmitToImageReference() })
856", assemblyName: "DerivedAssembly3", references: new List<MetadataReference>() { baseAssembly.EmitToImageReference() }).VerifyDiagnostics();
867}", references: new List<MetadataReference>() { derivedAssembly.EmitToImageReference() })
1465}", references: new List<MetadataReference>() { TestReferences.SymbolsTests.NoPia.NoPIAGenericsAsm1 })
1497}", references: new List<MetadataReference>() { TestReferences.SymbolsTests.NoPia.NoPIAGenericsAsm1 })
1522}", references: new List<MetadataReference>() { TestReferences.SymbolsTests.NoPia.NoPIAGenericsAsm1 })
1558}", references: new List<MetadataReference>() { TestReferences.SymbolsTests.NoPia.NoPIAGenericsAsm1 })
1595CSharpCompilation comp2 = CreateCompilationWithMscorlib461(source2, new MetadataReference[] { new CSharpCompilationReference(comp1, embedInteropTypes: true) }, assemblyName: "Bar948674_1");
1606CSharpCompilation comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { new CSharpCompilationReference(comp2), new CSharpCompilationReference(comp1, embedInteropTypes: true) });
1614comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) });
1648CSharpCompilation comp2 = CreateCompilationWithMscorlib461(source2, new MetadataReference[] { new CSharpCompilationReference(comp1, embedInteropTypes: true) }, assemblyName: "Bar948674_2");
1659CSharpCompilation comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { new CSharpCompilationReference(comp2), new CSharpCompilationReference(comp1, embedInteropTypes: true) });
1670comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) });
1704CSharpCompilation comp2 = CreateCompilationWithMscorlib461(source2, new MetadataReference[] { new CSharpCompilationReference(comp1, embedInteropTypes: true) }, assemblyName: "Bar948674_3");
1713CSharpCompilation comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { new CSharpCompilationReference(comp2), new CSharpCompilationReference(comp1, embedInteropTypes: true) });
1721comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) });
1752CSharpCompilation comp2 = CreateCompilationWithMscorlib461(source2, new MetadataReference[] { new CSharpCompilationReference(comp1, embedInteropTypes: true) }, assemblyName: "Bar948674_4");
1761CSharpCompilation comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { new CSharpCompilationReference(comp2), new CSharpCompilationReference(comp1, embedInteropTypes: true) });
1772comp3 = CreateCompilationWithMscorlib461(source3, new MetadataReference[] { comp2.EmitToImageReference(), comp1.EmitToImageReference().WithEmbedInteropTypes(true) });
Semantics\InitOnlyMemberTests.cs (18)
3256var reference = CreateMetadataReferenceFromIlSource(il);
3347var reference = CreateMetadataReferenceFromIlSource(il);
3465var reference = CreateMetadataReferenceFromIlSource(il);
3564var reference = CreateMetadataReferenceFromIlSource(il);
3628var reference = CreateMetadataReferenceFromIlSource(il);
3687var reference = CreateMetadataReferenceFromIlSource(il);
3737var reference = CreateMetadataReferenceFromIlSource(il);
3805var reference = CreateMetadataReferenceFromIlSource(il);
3883var reference = CreateMetadataReferenceFromIlSource(il);
3971var reference = CreateMetadataReferenceFromIlSource(il);
4054var reference = CreateMetadataReferenceFromIlSource(il);
4611new MetadataReference[] { new CSharpCompilationReference(piaCompilation, embedInteropTypes: true) },
4651var corlibWithoutIsExternalInitRef = CreateEmptyCompilation(corlib_cs, assemblyName: "corlibWithoutIsExternalInit")
4654var corlibWithIsExternalInitRef = CreateEmptyCompilation(corlib_cs + IsExternalInitTypeDefinition, assemblyName: "corlibWithIsExternalInit")
4657var libWithIsExternalInitRef = CreateEmptyCompilation(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit")
4660var libWithIsExternalInitRef2 = CreateEmptyCompilation(IsExternalInitTypeDefinition, references: new[] { corlibWithoutIsExternalInitRef }, assemblyName: "libWithIsExternalInit2")
4814var corlibWithoutIsExternalInitRef = AsReference(CreateEmptyCompilation(corlib_cs), useCompilationReference);
4815var corlibWithIsExternalInitRef = AsReference(CreateEmptyCompilation(corlib_cs + IsExternalInitTypeDefinition), useCompilationReference);
Semantics\NativeIntegerTests.cs (55)
186var ref2 = comp.EmitToImageReference();
702var ref2 = comp.EmitToImageReference();
846var ref1 = comp.EmitToImageReference();
884var ref2 = comp.EmitToImageReference();
957var ref1 = comp.EmitToImageReference();
1001var ref2 = comp.EmitToImageReference();
1050var refA1 = comp.EmitToImageReference();
1053var refA2 = comp.EmitToImageReference();
1138var ref1 = comp.EmitToImageReference(EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0"));
1151var refA = AsReference(comp, useCompilationReference);
1218var ref1 = comp.EmitToImageReference();
1513var ref2 = comp.EmitToImageReference();
1524void verifyReference(MetadataReference reference, bool includesIEquatable)
1595var ref2 = comp.EmitToImageReference();
1648var ref2 = comp.EmitToImageReference();
1727var refA = AsReference(comp, useCompilationReference);
1895var refA = AsReference(comp, useCompilationReference);
2070var refA = AsReference(comp, useCompilationReference);
2208var refA = AsReference(comp, useCompilationReference);
2300var refA = AsReference(comp, useCompilationReference);
2430var compA = CreateVisualBasicCompilation(sourceA, referencedAssemblies: Array.Empty<MetadataReference>());
2432var refA = compA.EmitToImageReference();
2599var refA = AsReference(comp, useCompilationReference);
2703var refA = AsReference(comp, useCompilationReference);
2841var refA = CompileIL(sourceA, prependDefaultHeader: false, autoInherit: false);
3118var ref2 = comp.EmitToImageReference();
3162var ref2 = comp.EmitToImageReference();
3197var ref2 = comp.EmitToImageReference();
3259var ref2 = comp.EmitToImageReference();
3302var ref2 = comp.EmitToImageReference();
3361var ref2 = comp.EmitToImageReference();
3451var ref1 = comp.EmitToImageReference();
3533var ref2 = comp.EmitToImageReference();
3566var ref2 = comp.EmitToImageReference();
3599var ref2 = comp.EmitToImageReference();
4598var refA = comp.EmitToImageReference(options: EmitOptions.Default.WithRuntimeMetadataVersion("4.0.0.0"));
4885var refA = AsReference(comp, useCompilationReference);
4997var refA = AsReference(comp, useCompilationReference);
5340var refA = AsReference(comp, useCompilationReference);
5488var refA = AsReference(comp, useCompilationReference);
5536var refA = AsReference(comp, useCompilationReference);
5580var refA = AsReference(comp, useCompilationReference);
5672var refA = AsReference(comp, useCompilationReference);
5714var refA = AsReference(comp, useCompilationReference);
5783var refA = AsReference(comp, useCompilationReference);
5845var refA = AsReference(comp, useCompilationReference);
5890var refA = AsReference(comp, useCompilationReference);
6020var refA = AsReference(comp, useCompilationReference);
6942var ref0 = comp.EmitToImageReference();
6971var ref0 = comp.EmitToImageReference();
7004var ref0 = comp.EmitToImageReference();
7219var ref2 = comp.EmitToImageReference();
13281var refA = comp.EmitToImageReference();
13654var refA = CompileIL(sourceA);
13717var refA = CompileIL(sourceA);
Semantics\NullableReferenceTypesTests.cs (134)
98IEnumerable<MetadataReference> references = null,
2062var reference = BasicCompilationUtils.CompileToMetadata(source1);
8707var ref0 = comp0.EmitToImageReference();
8813var compRefs0 = new MetadataReference[] { new CSharpCompilationReference(comp0) };
8836compRefs0 = new MetadataReference[] { new CSharpCompilationReference(comp0) };
8866compRefs0 = new MetadataReference[] { new CSharpCompilationReference(comp0) };
8945var comp1A = CreateCompilation(source1, references: new MetadataReference[] { new CSharpCompilationReference(comp0) });
9159references: new MetadataReference[] { new CSharpCompilationReference(comp0) });
9244var ref0 = comp0.EmitToImageReference();
9248var ref1 = comp1.EmitToImageReference();
9334var ref0 = comp0.EmitToImageReference();
9338var ref1 = comp1.EmitToImageReference();
9427var comp1 = CreateCompilation(source1, references: new MetadataReference[] { new CSharpCompilationReference(comp0) });
14336foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
14388foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
34309var reference = CreateNullableCompilation(new[] { source1, NotNullIfNotNullAttributeDefinition }).EmitToImageReference();
40307var ref0 = comp.EmitToImageReference();
44289var ref0 = comp.EmitToImageReference();
46237var ref0 = comp.EmitToImageReference();
46287var ref0 = comp.EmitToImageReference();
46794var ref0 = comp.EmitToImageReference();
46850var ref0 = comp.EmitToImageReference();
47455var ref0 = comp.EmitToImageReference();
47503var ref0 = comp.EmitToImageReference();
47544var ref0 = comp.EmitToImageReference();
56664var ref0 = comp0.EmitToImageReference();
56713var ref0 = comp0.EmitToImageReference();
56788var ref0 = comp0.EmitToImageReference();
56852var ref0 = comp0.EmitToImageReference();
56899var ref0 = comp0.EmitToImageReference();
56945var ref0 = comp0.EmitToImageReference();
57306var ref0 = comp0.EmitToImageReference();
57552var ref0 = comp0.EmitToImageReference();
57567var ref1 = comp1.EmitToImageReference();
58435var ref0 = comp0.EmitToImageReference();
58450var ref1 = comp1.EmitToImageReference();
60343var ref0 = comp0.EmitToImageReference();
60468var ref0 = comp0.EmitToImageReference();
60530var ref0 = comp0.EmitToImageReference();
60585var ref0 = comp0.EmitToImageReference();
60663var ref0 = comp0.EmitToImageReference();
60752var ref0 = comp0.EmitToImageReference();
60857var ref0 = comp0.EmitToImageReference();
61144var ref0 = comp0.EmitToImageReference();
61551" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) });
61602" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) });
64605var ref0 = comp0.EmitToImageReference();
64663var ref0 = comp0.EmitToImageReference();
64736var ref0 = comp0.EmitToImageReference();
76928new MetadataReference[] { new CSharpCompilationReference(piaCompilation, embedInteropTypes: true) },
80948var ref0 = BasicCompilationUtils.CompileToMetadata(source0);
81402var ref0 = comp0.EmitToImageReference();
88108var ref0 = CompileIL(source0);
88136var ref0 = CompileIL(source0);
88169var ref0 = CompileIL(source0);
88198var ref0 = CompileIL(source0);
92822var ref0 = comp0.EmitToImageReference();
92880var ref0 = comp0.EmitToImageReference();
92922var ref0 = comp0.EmitToImageReference();
92993var ref0 = comp0.EmitToImageReference();
93037var ref0 = comp0.EmitToImageReference();
93110var ref0 = comp0.EmitToImageReference();
93154var ref0 = comp0.EmitToImageReference();
93255var ref0 = comp0.EmitToImageReference();
93296var ref0 = comp0.EmitToImageReference();
93343var ref0 = comp0.EmitToImageReference();
93538var ref0 = comp0.EmitToImageReference();
93594var ref0 = comp0.EmitToImageReference();
93667var ref0 = comp0.EmitToImageReference();
93795var ref0 = comp0.EmitToImageReference();
93833var ref0 = comp0.EmitToImageReference();
93919var ref0 = comp0.EmitToImageReference();
94131var ref0 = comp0.EmitToImageReference();
94145var ref1 = comp1.EmitToImageReference();
95149var ref0 = comp0.EmitToImageReference();
101287foreach (var reference in new[] { comp1.ToMetadataReference(), comp1.EmitToImageReference() })
101368foreach (var reference in new[] { comp1.ToMetadataReference(), comp1.EmitToImageReference() })
106107foreach (var reference in new[] { comp1.ToMetadataReference(), comp1.EmitToImageReference() })
109251foreach (var reference in new[] { comp0.ToMetadataReference(), comp0.EmitToImageReference() })
110530var ref0 = CompileIL(source0);
110602var ref0 = CompileIL(source0);
110942var ref0 = CompileIL(source0);
110997MetadataReference ref0 = comp.ToMetadataReference();
111323var ref0 = comp0.EmitToImageReference();
111342var ref0 = comp0.EmitToImageReference();
111372var ref0 = comp0.EmitToImageReference();
111408var ref0 = comp0.EmitToImageReference();
111441var ref0 = comp0.EmitToImageReference();
111477var ref0 = comp0.EmitToImageReference();
111510var ref0 = comp0.EmitToImageReference();
111551var ref0 = comp0.EmitToImageReference();
111847var ref0 = comp0.EmitToImageReference();
111889var ref0 = comp0.EmitToImageReference();
111910var ref0 = comp0.EmitToImageReference();
111984var ref0 = comp0.EmitToImageReference();
112072var ref0 = comp0.EmitToImageReference();
112127var ref0 = comp0.EmitToImageReference();
112212var ref0 = comp0.EmitToImageReference();
112280var ref0 = comp0.EmitToImageReference();
112533var ref0 = comp0.EmitToImageReference();
112640MetadataReference ref0 = comp0.ToMetadataReference();
116779var ref1 = BasicCompilationUtils.CompileToMetadata(source1);
138718var comp1 = CreateCompilation(source1, assemblyName: nameof(source1)).VerifyDiagnostics().EmitToImageReference();
144959var spanRef = CreateCompilation(TestSources.Span, options: TestOptions.UnsafeReleaseDll)
149942var refA = AsReference(comp, useCompilationReference);
150215var refA = AsReference(comp, useCompilationReference);
150481var refA = AsReference(comp, useCompilationReference);
150604var refA = AsReference(comp, useCompilationReference);
151246var refA = AsReference(comp, useCompilationReference);
151621var refA = AsReference(comp, useCompilationReference);
151997var refA = AsReference(comp, useCompilationReference);
152370var refA = AsReference(comp, useCompilationReference);
152676var refA = AsReference(comp, useCompilationReference);
152967var refA = AsReference(comp, useCompilationReference);
153218var refA = AsReference(comp, useCompilationReference);
153425var refA = AsReference(comp, useCompilationReference);
154505var refA = AsReference(comp, useCompilationReference);
154583var refA = AsReference(comp, useCompilationReference);
154964var refA = AsReference(comp, useCompilationReference);
155064var refA = AsReference(comp, useCompilationReference);
155125var refA = AsReference(comp, useCompilationReference);
155288var refA = AsReference(comp, useCompilationReference);
155337var refA = AsReference(comp, useCompilationReference);
155381var refA = AsReference(comp, useCompilationReference);
155815var nullableAttrRef = useImageReference ? nullableAttrComp.EmitToImageReference() : nullableAttrComp.ToMetadataReference();
155834var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference();
156547var ref0 = comp.EmitToImageReference();
156595var ref0 = comp.EmitToImageReference();
157009var ref0 = comp.EmitToImageReference();
157045var ref0 = comp.EmitToImageReference();
157201var refA = AsReference(comp, useCompilationReference);
160364" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) });
160415" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) });
160465" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) });
Semantics\RefFieldTests.cs (72)
99var refA = AsReference(comp, useCompilationReference);
177var refA = AsReference(comp, useCompilationReference);
246var refA = AsReference(comp, useCompilationReference);
304var refA = CompileIL(sourceA);
361var refA = CompileIL(sourceA);
499var refA = CompileIL(sourceA);
528var refA = CompileIL(sourceA, prependDefaultHeader: false, embedInteropTypes: true);
542var refB = comp.EmitToImageReference();
590var refA = CompileIL(sourceA);
619var refA = CompileIL(sourceA);
1874var refA = CompileIL(sourceA);
1906var refA = CompileIL(sourceA);
1937var refA = CompileIL(sourceA, prependDefaultHeader: false);
1946var refB = CompileIL(sourceB);
1979var refA = CompileIL(sourceA);
2004var refB = verifier.Compilation.EmitToImageReference();
2088var refA = CompileIL(sourceA);
2145var refA = AsReference(comp, useCompilationReference);
2148var refAB = AsReference(comp, useCompilationReference);
2229var refA = compA.EmitToImageReference(emitOptions);
2247var refB = compB.EmitToImageReference();
2338var refA = AsReference(comp, useCompilationReference);
2466var refA = CompileIL(sourceA);
10158var refA = comp.EmitToImageReference();
10621var refA = AsReference(comp, useCompilationReference);
10652var refA = AsReference(comp, useCompilationReference);
10686var refA = AsReference(comp, useCompilationReference);
10745var refA = AsReference(comp, useCompilationReference);
10801var refA = AsReference(comp, useCompilationReference);
10843var refA = AsReference(comp, useCompilationReference);
10893var refA = AsReference(comp, useCompilationReference);
11423var ref0 = CompileIL(source0, prependDefaultHeader: false);
11453var refA = AsReference(comp, useCompilationReference);
15743var refA = comp.EmitToImageReference(embedInteropTypes: true);
17229var refA = AsReference(comp, useCompilationReference);
17284var refA = AsReference(comp, useCompilationReference);
17334var refA = AsReference(comp, useCompilationReference);
17442var refA = AsReference(comp, useCompilationReference);
17537var refA = AsReference(comp, useCompilationReference);
17611var refA = AsReference(comp, useCompilationReference);
22387var refA = AsReference(comp, useCompilationReference);
22505var refA = AsReference(comp, useCompilationReference);
22802var refA = AsReference(comp, useCompilationReference);
23087var refA = AsReference(comp, useCompilationReference);
23276var refA = CompileIL(ilSource);
23374var refA = AsReference(comp, useCompilationReference);
24145var refA = AsReference(comp, useCompilationReference);
24361var refA = CompileIL(sourceA, prependDefaultHeader: false);
24467var refA = CompileIL(sourceA, prependDefaultHeader: false);
24575var refA = CompileIL(sourceA, prependDefaultHeader: false);
24702var refA = AsReference(comp, useCompilationReference);
24786var refA = AsReference(comp, useCompilationReference);
24885var refA = AsReference(comp, useCompilationReference);
24936var refA = AsReference(comp, useCompilationReference);
24995var refA = AsReference(comp, useCompilationReference);
25025var refA = AsReference(comp, useCompilationReference);
25063var refA = AsReference(comp, useCompilationReference);
25122var refA = AsReference(comp, useCompilationReference);
25200var refA = AsReference(comp, useCompilationReference);
25271var refA = AsReference(comp, useCompilationReference);
25387var refA = AsReference(comp, useCompilationReference);
25435var refA = AsReference(comp, useCompilationReference);
26409var refA = CompileIL(sourceA, prependDefaultHeader: false);
26454var refA = CompileIL(sourceA, prependDefaultHeader: false);
26493var refA = CompileIL(sourceA, prependDefaultHeader: false);
26592var ref0 = comp.EmitToImageReference(Microsoft.CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0"));
26601var ref1 = comp.EmitToImageReference();
26649var refLowerVersion = comp.EmitToImageReference();
26653var refHigherVersion = comp.EmitToImageReference();
26662var ref1 = comp.EmitToImageReference();
26717var ref0 = comp.EmitToImageReference(Microsoft.CodeAnalysis.Emit.EmitOptions.Default.WithRuntimeMetadataVersion("0.0.0.0"));
26726var ref1 = comp.EmitToImageReference();
Semantics\SpanStackSafetyTests.cs (8)
1929references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef },
1946references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() },
1963references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef },
1980references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() },
2007references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef },
2024references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() },
2048references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef },
2065references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef, reference.EmitToImageReference() },
Semantics\UseSiteErrorTests.cs (24)
936CreateCompilation(text, new MetadataReference[] { delegatesWithoutInvokeReference }).VerifyDiagnostics(
997CreateCompilation(text, new MetadataReference[] { csharpAssemblyReference, ilAssemblyReference }).VerifyDiagnostics(
1075var xRef = CreateCompilation(xSource, assemblyName: "Test").EmitToImageReference();
1107var xRef = CreateCompilation(xSource, assemblyName: "X").EmitToImageReference();
1136var xRef = CreateCompilation(xSource, assemblyName: "X").EmitToImageReference();
1661var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference();
1662var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference();
1732var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference();
1733var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference();
1787var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference();
1788var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference();
1844var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference();
1845var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference();
1901var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference();
1902var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference();
1948var missingRef = CreateCompilation(missingSource, assemblyName: "Missing").EmitToImageReference();
1949var libRef = CreateCompilation(libSource, new[] { missingRef }).EmitToImageReference();
2195CSharpCompilation comp2 = CreateCompilation(source2, new MetadataReference[] { new CSharpCompilationReference(comp1) });
2213CSharpCompilation comp3 = CreateCompilation(source3, new MetadataReference[] { new CSharpCompilationReference(comp2) });
2233comp3 = CreateCompilation(source3, new MetadataReference[] { comp2.EmitToImageReference() });
2284var successfulCompilation = CreateCompilation(source, new MetadataReference[] { unavailableAssemblyReference, csharpAssemblyReference, ilAssemblyReference });
2287var failingCompilation = CreateCompilation(source, new MetadataReference[] { csharpAssemblyReference, ilAssemblyReference });
2458private static readonly MetadataReference UnmanagedUseSiteError_Ref1 = CreateCompilation(@"
2464private static readonly MetadataReference UnmanagedUseSiteError_Ref2 = CreateCompilation(@"
Semantics\WarningVersionTests.cs (9)
383var moduleReference = comp1.EmitToImageReference();
392CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
394CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
672var moduleReference = comp1.EmitToImageReference();
683CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
685CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
702var moduleReference = comp1.EmitToImageReference();
713CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
715CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1368)
BadSymbolReference.cs (8)
41}", new MetadataReference[] { cl2, cl3 });
360var compilation2 = CreateCompilation(a_cs, new MetadataReference[] { cl3 });
460var cl3Compilation = CreateCompilation(cl3Source, new MetadataReference[] { cl2 });
464var compilation3 = CreateCompilation(a_cs, new MetadataReference[] { new CSharpCompilationReference(cl3Compilation) });
468var cl3BadCompilation1 = CreateCompilation(cl3Source, new MetadataReference[] { cl3 });
470var compilation4 = CreateCompilation(a_cs, new MetadataReference[] { new CSharpCompilationReference(cl3BadCompilation1) });
601var compilation5 = CreateCompilation(a_cs, new MetadataReference[] { new CSharpCompilationReference(cl3BadCompilation2) });
796var libRef = CreateEmptyCompilation(libSource, new[] { MscorlibRef }, assemblyName: "System.Drawing").EmitToImageReference();
Compilation\CompilationAPITests.cs (55)
339var listRef = new List<MetadataReference>();
366var ref1 = comp.ExternalReferences[0];
495comp = comp.AddReferences(Enumerable.Empty<MetadataReference>());
518var hs = new HashSet<MetadataReference> { ref1, ref2, ref3 };
526var col = new Collection<MetadataReference> { ref1, ref2, ref3 };
534var stack = new ConcurrentStack<MetadataReference> { };
545var queue = new ConcurrentQueue<MetadataReference> { };
615references: new MetadataReference[] { MscorlibRef });
617var mtref = refcomp.EmitToImageReference(aliases: ImmutableArray.Create("a", "Alias(*#$@^%*&)"));
625references: new MetadataReference[] { MscorlibRef, mtref }
636references: new MetadataReference[] { MscorlibRef, mtref }
649references: new MetadataReference[] { MscorlibRef, mtref }
683references: new MetadataReference[] { MscorlibRef });
685var mtref = refcomp.EmitToImageReference(aliases: ImmutableArray.Create("a", "Alias(*#$@^%*&)"));
693references: new MetadataReference[] { MscorlibRef, mtref }
704references: new MetadataReference[] { MscorlibRef, mtref }
717references: new MetadataReference[] { MscorlibRef, mtref }
966var listRef = new List<MetadataReference>();
989references: new MetadataReference[] { netModule1.EmitToImageReference() },
1003references: new MetadataReference[] { netModule2.EmitToImageReference() },
1018references: new MetadataReference[] { netModule1.EmitToImageReference(), netModule2.EmitToImageReference() },
1045references: new MetadataReference[] { netModule1.EmitToImageReference() },
1059references: new MetadataReference[] { netModule1.EmitToImageReference() },
1073references: new MetadataReference[] { netModule2.EmitToImageReference(), netModule3.EmitToImageReference() },
1109references: new MetadataReference[] { netModule1.EmitToImageReference() },
1134references: new MetadataReference[] { netModule1.EmitToImageReference() },
1148references: new MetadataReference[] { netModule1.EmitToImageReference(), netModule2.EmitToImageReference() },
1169foreach (var item in vbComp.References)
1192new MetadataReference[] { compRef1, compRef2 });
1299foreach (var item in comp.References)
1342Assert.Throws<ArgumentNullException>(() => CSharpCompilation.Create("goo", references: new MetadataReference[] { null }));
1421var listRef = new List<MetadataReference> { ref1, ref2, ref3, ref4 };
1435var ref1 = InvalidRef;
2248var references = new MetadataReference[]
2299var mdRef = MetadataReference.CreateFromImage(refData);
2353var reference = comp.GetMetadataReference(assemblySmb);
2358var reference2 = comp2.GetMetadataReference(assemblySmb);
2778var compilation = CreateCompilation("", references: Array.Empty<MetadataReference>(), targetFramework: TargetFramework.Empty);
2968var compilation = CreateCompilation("", references: Array.Empty<MetadataReference>(), targetFramework: TargetFramework.Empty);
3101var moduleReference = MetadataReference.CreateFromStream(moduleStream, MetadataReferenceProperties.Module);
3120var moduleReference = MetadataReference.CreateFromStream(moduleStream, MetadataReferenceProperties.Module);
3141var moduleReference = MetadataReference.CreateFromStream(moduleStream, MetadataReferenceProperties.Assembly);
3470MetadataReference reference = useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference();
3498MetadataReference reference = useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference();
3526MetadataReference reference1 = getReference(referenceComp1);
3527MetadataReference reference2 = getReference(referenceComp2);
3543MetadataReference getReference(CSharpCompilation referenceComp1)
3564MetadataReference reference1 = getReference(referenceComp1);
3565MetadataReference reference2 = getReference(referenceComp2);
3583MetadataReference getReference(CSharpCompilation referenceComp1)
3604var corlibReference = corlib.EmitToImageReference();
3607var otherReference = other.EmitToImageReference();
3639var corlibReference = corlib.EmitToImageReference(aliases: ImmutableArray.Create("corlib"));
3664var corlibReference = corlib.EmitToImageReference();
3667var otherReference = other.EmitToImageReference(aliases: ImmutableArray.Create("other"));
Compilation\ReferenceManagerTests.cs (147)
39var ifaceImageRef = ifaceDef.EmitToImageReference();
51}", references: new MetadataReference[] { ifaceDef.ToMetadataReference(), wimpl },
70var testRefV1 = CreateCompilation("public class E : D { }", new MetadataReference[] { new CSharpCompilationReference(refV1), v2 }, assemblyName: "testRefV1");
73var testRefV2 = CreateCompilation("public class E : D { }", new MetadataReference[] { new CSharpCompilationReference(refV2), v1 }, assemblyName: "testRefV2");
105var v1 = MetadataReference.CreateFromImage(TestResources.General.C1);
106var v2 = MetadataReference.CreateFromImage(TestResources.General.C2);
112var testRefV1 = CreateCompilation("public class E { }", new MetadataReference[] { new CSharpCompilationReference(refV1), v2 });
115var testRefV2 = CreateCompilation("public class E { }", new MetadataReference[] { new CSharpCompilationReference(refV2), v1 });
559references: new MetadataReference[] { MinCorlibRef, new CSharpCompilationReference(libV1) },
573references: new MetadataReference[] { MinCorlibRef, new CSharpCompilationReference(refLibV1), new CSharpCompilationReference(libV2) });
707references: new MetadataReference[] { MetadataReference.CreateFromImage(refLibV1.EmitToArray()), new CSharpCompilationReference(libV2) },
829CSharpCompilation createCompilationCore(string s, IEnumerable<MetadataReference> references)
856var r1 = MetadataReference.CreateFromFile(p1);
857var r2 = MetadataReference.CreateFromFile(p2);
858var r3 = MetadataReference.CreateFromFile(p3);
868references: new MetadataReference[] { MscorlibRef_v4_0_30316_17626, r1, r2 },
927var m1 = MetadataReference.CreateFromFile(p1, new MetadataReferenceProperties(MetadataImageKind.Module));
928var m2 = MetadataReference.CreateFromFile(p2, new MetadataReferenceProperties(MetadataImageKind.Module));
931references: new MetadataReference[] { m1, m2 });
996var r1 = MetadataReference.CreateFromFile(p1);
997var r2 = MetadataReference.CreateFromFile(p2);
1020new[] { MetadataReference.CreateFromFile(p1), MetadataReference.CreateFromFile(p2) },
1252return ImmutableArray.Create(MetadataReference.CreateFromFile(path1));
1256return ImmutableArray.Create(MetadataReference.CreateFromFile(path2));
1394var refB = MetadataReference.CreateFromImage(b.EmitToArray());
1404var refA2 = MetadataReference.CreateFromImage(a2.EmitToArray());
1441var refB = MetadataReference.CreateFromImage(b.EmitToArray());
1445var refA2 = MetadataReference.CreateFromImage(a2.EmitToArray());
1548var ilRef = CompileIL(il, prependDefaultHeader: false);
1556var ilRef = CompileIL(il, prependDefaultHeader: false);
1563var ilRef = CompileIL(il, prependDefaultHeader: false);
1570var ilRef = CompileIL(il, prependDefaultHeader: false);
1644var ilRef = CompileIL(il, prependDefaultHeader: false);
1698var aRef = CompileIL(srcA, prependDefaultHeader: false);
1764var moduleRef = CreateCompilation("public class TypeFromModule : TypeDependedOnByModule { }", new[] { assemblyRef }, options: TestOptions.ReleaseModule, assemblyName: "lib2").EmitToImageReference();
1766var comp1 = CreateCompilation(text1, new MetadataReference[]
1815var moduleRef = CreateCompilation("public class C { }", options: TestOptions.ReleaseModule, assemblyName: "lib").EmitToImageReference();
1817var comp1 = CreateCompilation(text1, new MetadataReference[]
1865var moduleRef = module.EmitToImageReference();
1894var main = CreateEmptyCompilation(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef }, options: TestOptions.ReleaseDll);
1900main = CreateEmptyCompilation(mainSource, new MetadataReference[] { r1, MscorlibFacadeRef, SystemRuntimeFacadeRef });
2180var refVectors40 = vectors40.EmitToImageReference();
2181var refVectors41 = vectors41.EmitToImageReference();
2317var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference();
2318var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2347var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference();
2348var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2379var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference();
2380var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2415var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference();
2416var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2451var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference();
2452var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2489var bRef = CreateCompilationWithMscorlib461("public class B { }", assemblyName: "B").EmitToImageReference();
2490var aRef = CreateCompilationWithMscorlib461("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2491var dRef = CreateCompilationWithMscorlib461("public class D : A { }", new[] { aRef, bRef }, assemblyName: "D").EmitToImageReference();
2527var bRef = CreateCompilationWithMscorlib46("public class B { }", assemblyName: "B").EmitToImageReference();
2528var aRef = CreateCompilationWithMscorlib46("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2530var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2549var bRef = CreateCompilationWithMscorlib46("public class B { }", assemblyName: "B").EmitToImageReference();
2550var aRef = CreateCompilationWithMscorlib46("public class A : B { }", new[] { bRef }, assemblyName: "A").EmitToImageReference();
2552var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2577var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2578var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2579var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public class B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2581var aRef = CreateEmptyCompilation("public class A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference();
2582var dRef = CreateEmptyCompilation("public class D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference();
2584var b3RefX = b3Ref.WithAliases(ImmutableArray.Create("X"));
2585var b3RefY = b3Ref.WithAliases(ImmutableArray.Create("Y"));
2587var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2631var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2632var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2633var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2634var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2636var aRef = CreateEmptyCompilation(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference();
2637var dRef = CreateEmptyCompilation(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference();
2639var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2667var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2668var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2669var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2670var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, assemblyName: "B").EmitToImageReference();
2672var aRef = CreateEmptyCompilation(@"public interface A : B { }", new[] { MscorlibRef, b1Ref }, assemblyName: "A").EmitToImageReference();
2673var dRef = CreateEmptyCompilation(@"public interface D : B { }", new[] { MscorlibRef, b2Ref }, assemblyName: "D").EmitToImageReference();
2675var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2703var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference();
2706var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>());
2719var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference();
2722var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>());
2742var bRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "B").EmitToImageReference();
2747var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2768var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference();
2772var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2795var bRef = CreateCompilationWithMscorlib46("public interface B { }", assemblyName: "B").EmitToImageReference();
2796var dRef = CreateCompilationWithMscorlib46("public interface D { }", assemblyName: "D").EmitToImageReference();
2798var mRef = CreateCompilationWithMscorlib46("public interface M : B { }", new[] { bRef }, options: TestOptions.ReleaseModule.WithModuleName("M.netmodule")).EmitToImageReference();
2799var nRef = CreateCompilationWithMscorlib46("public interface N : D { }", new[] { dRef }, options: TestOptions.ReleaseModule.WithModuleName("N.netmodule")).EmitToImageReference();
2801var aRef = CreateCompilationWithMscorlib46("public interface A : D { }", new[] { dRef }, assemblyName: "A").EmitToImageReference();
2803var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2832var b1Ref = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class B { }", options: s_signedDll, assemblyName: "B").EmitToImageReference();
2833var b2Ref = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class B { }", options: s_signedDll, assemblyName: "B").EmitToImageReference();
2834var b3Ref = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public class B { }", options: s_signedDll, assemblyName: "B").EmitToImageReference();
2836var aRef = CreateCompilationWithMscorlib46(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class A : B { }", new[] { b1Ref }, options: s_signedDll, assemblyName: "A").EmitToImageReference();
2838var resolver = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2873var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2874var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2876var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
2877var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
2879var resolverA = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2885var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef },
2890var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2939var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2940var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", references: new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
2942var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
2943var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
2945var resolverA = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2951var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef },
2956var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
2999var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3000var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3002var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
3003var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
3005var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref },
3008var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
3043var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3044var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3045var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3046var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3048var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
3049var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
3051var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref },
3054var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
3109var b1Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3110var b2Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3111var b3Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""3.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3112var b4Ref = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""4.0.0.0"")] public interface B { }", new[] { MscorlibRef }, options: s_signedDll, assemblyName: "B").EmitToImageReference();
3114var dRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface D : B { }", new[] { MscorlibRef, b2Ref }, options: s_signedDll, assemblyName: "D").EmitToImageReference();
3115var eRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface E : B { }", new[] { MscorlibRef, b1Ref }, options: s_signedDll, assemblyName: "E").EmitToImageReference();
3117var aRef = CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public interface A : D, E { }", new[] { MscorlibRef, dRef, eRef, b1Ref, b2Ref },
3120var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
3178var aRef = CreateEmptyCompilation(@"public interface A { System.Diagnostics.Process PA { get; } }", new[] { Net20.References.mscorlib, Net20.References.System },
3181var bRef = CreateEmptyCompilation(@"public interface B { System.Diagnostics.Process PB { get; } }", new[] { MscorlibRef_v4_0_30316_17626, NetFramework.System },
3184var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
3218var aRef = CreateEmptyCompilation(@"public interface A { C CA { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C2 },
3221var bRef = CreateEmptyCompilation(@"public interface B { C CB { get; } }", new[] { MscorlibRef, TestReferences.SymbolsTests.Versioning.C1 },
3224var resolverC = new TestMissingMetadataReferenceResolver(new Dictionary<string, MetadataReference>
Compilation\UsedAssembliesTests.cs (146)
74void verify<TAssemblySymbol>(string source2, MetadataReference reference) where TAssemblySymbol : AssemblySymbol
81private void AssertUsedAssemblyReferences(Compilation comp, MetadataReference[] expected, DiagnosticDescription[] before, DiagnosticDescription[] after, MetadataReference[] specificReferencesToAssert)
88void assertUsedAssemblyReferences(Compilation comp, MetadataReference[] expected, DiagnosticDescription[] before, DiagnosticDescription[] after, MetadataReference[] specificReferencesToAssert)
118foreach (var reference in tryRemove)
243private void AssertUsedAssemblyReferences(Compilation comp, params MetadataReference[] expected)
248private void AssertUsedAssemblyReferences(Compilation comp, MetadataReference[] expected, MetadataReference[] specificReferencesToAssert)
253private Compilation AssertUsedAssemblyReferences(string source, MetadataReference[] references, params MetadataReference[] expected)
256private Compilation AssertUsedAssemblyReferences(string source, MetadataReference[] references, MetadataReference[] expected, CSharpParseOptions parseOptions, CSharpCompilationOptions options = null)
263private Compilation AssertUsedAssemblyReferences(string source, params MetadataReference[] references)
268private static void AssertUsedAssemblyReferences(string source, MetadataReference[] references, params DiagnosticDescription[] expected)
287private ImmutableArray<MetadataReference> CompileWithUsedAssemblyReferences(string source, TargetFramework targetFramework, params MetadataReference[] references)
292private ImmutableArray<MetadataReference> CompileWithUsedAssemblyReferences(string source, TargetFramework targetFramework, CSharpCompilationOptions options, params MetadataReference[] references)
304private ImmutableArray<MetadataReference> CompileWithUsedAssemblyReferences(Compilation comp, string expectedOutput = null, MetadataReference[] specificReferencesToAssert = null)
306ImmutableArray<MetadataReference> result = default;
324ImmutableArray<MetadataReference> compileWithUsedAssemblyReferences(Compilation comp, string expectedOutput = null, MetadataReference[] specificReferencesToAssert = null)
336foreach (var reference in tryRemove)
351private ImmutableArray<MetadataReference> CompileWithUsedAssemblyReferences(string source, params MetadataReference[] references)
356private void CompileWithUsedAssemblyReferences(string source, CSharpCompilationOptions options, params MetadataReference[] references)
401void verify<TAssemblySymbol>(string source2, MetadataReference reference) where TAssemblySymbol : AssemblySymbol
435void verify<TAssemblySymbol>(string source2, MetadataReference reference) where TAssemblySymbol : AssemblySymbol
456var comp1ImageRef = comp1.EmitToImageReference();
487void verify<TAssemblySymbol>(string source2, MetadataReference reference) where TAssemblySymbol : AssemblySymbol
508var comp0ImageRef = comp0.EmitToImageReference();
522var comp1ImageRef = comp1.EmitToImageReference();
558void verify<TAssemblySymbol>(string source2, MetadataReference reference0, MetadataReference reference1) where TAssemblySymbol : AssemblySymbol
578var comp0ImageRef = comp0.EmitToImageReference();
592var comp1Ref = comp1.EmitToImageReference();
605var comp2ImageRef = comp2.EmitToImageReference();
656Compilation verify2<TAssemblySymbol>(string source2, MetadataReference reference0, MetadataReference reference1) where TAssemblySymbol : AssemblySymbol
663void verify3<TAssemblySymbol>(string source3, params MetadataReference[] references) where TAssemblySymbol : AssemblySymbol
733void verify(MetadataReference reference, string source)
933void verify(MetadataReference reference0, MetadataReference reference1, string source)
1094void verify(MetadataReference reference0, MetadataReference reference1, string source, bool hasTypeReferencesInUsing = true)
1098AssertUsedAssemblyReferences(comp2, hasTypeReferencesInUsing ? references : new MetadataReference[] { }, references);
1264void verify(MetadataReference reference0, MetadataReference reference1, string source)
1348void verify(MetadataReference reference0, MetadataReference reference1, string source)
1380void verify<TAssemblySymbol>(string source2, MetadataReference reference) where TAssemblySymbol : AssemblySymbol
1452void verify(MetadataReference reference0, MetadataReference reference1, string source)
1632var comp6ImageRef = comp6.EmitToImageReference();
1636var comp7ImageRef = comp7.EmitToImageReference(embedInteropTypes: false);
1695var comp1ImageRef = comp1.EmitToImageReference();
1706var comp2ImageRef = comp2.EmitToImageReference();
1804var comp1ImageRef = comp1.EmitToImageReference();
1887var comp1ImageRef = comp1.EmitToImageReference();
1945var comp6ImageRef = comp6.EmitToImageReference();
1949var comp7ImageRef = comp7.EmitToImageReference(embedInteropTypes: false);
1970var comp1ImageRef = comp1.EmitToImageReference();
2002void verify<TAssemblySymbol>(string source2, MetadataReference reference) where TAssemblySymbol : AssemblySymbol
2148void verify(MetadataReference reference, string source2)
2315static void verify1(MetadataReference reference, string source, params DiagnosticDescription[] expected)
2337void verify2(MetadataReference reference, string source, string @using)
2402void verify(MetadataReference reference, string source2)
2429var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2442var comp1ImageRef = comp1.EmitToImageReference();
2462var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2469void verify<TAssemblySymbol>(string source2, MetadataReference reference0, MetadataReference reference1) where TAssemblySymbol : AssemblySymbol
2497var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2509var comp1ImageRef = comp1.EmitToImageReference();
2513var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2585var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2597var comp1ImageRef = comp1.EmitToImageReference();
2601var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2673var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2685var comp1ImageRef = comp1.EmitToImageReference();
2689var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2757var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2770var comp1ImageRef = comp1.EmitToImageReference();
2774var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2846var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2858var comp1ImageRef = comp1.EmitToImageReference();
2862var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2934var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
2946var comp1ImageRef = comp1.EmitToImageReference();
2950var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
2998var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
3037var comp1ImageRef = comp1.EmitToImageReference();
3041var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
3307var comp0ImageRef = comp0.EmitToImageReference(embedInteropTypes: true);
3347var comp1ImageRef = comp1.EmitToImageReference();
3351var comp3ImageRef = comp3.EmitToImageReference(embedInteropTypes: false);
3535void verifyNotUsed(string source2, MetadataReference ref0, MetadataReference ref1)
3689void verifyDiagnostics(MetadataReference reference0, MetadataReference reference1, string source, params DiagnosticDescription[] diagnostics)
3831void verifyDiagnostics(MetadataReference reference0, MetadataReference reference1, string source, params DiagnosticDescription[] diagnostics)
3838void verify(MetadataReference reference0, MetadataReference reference1, string source)
3915void verify(MetadataReference reference0, MetadataReference reference1, string source)
4020void verify(MetadataReference reference0, MetadataReference reference1, string source, bool hasTypeReferencesInUsing = true)
4024AssertUsedAssemblyReferences(comp2, hasTypeReferencesInUsing ? references : new MetadataReference[] { }, references);
4123void verify(MetadataReference reference0, MetadataReference reference1, string source, bool hasTypeReferencesInUsing = true)
4127AssertUsedAssemblyReferences(comp2, hasTypeReferencesInUsing ? references : new MetadataReference[] { }, references);
4326void verify(MetadataReference reference0, MetadataReference reference1, MetadataReference reference2, string source)
4445void verify(MetadataReference reference0, MetadataReference reference1, MetadataReference reference2, string source)
4552new MetadataReference[] { },
4581new MetadataReference[] { },
4623void verify(MetadataReference reference0, MetadataReference reference1, MetadataReference reference2, string source, int namespaceOrdinalReferencedInUsings = 0)
4628AssertUsedAssemblyReferences(comp2, namespaceOrdinalReferencedInUsings switch { 1 => references, 2 => expected, _ => new MetadataReference[] { } }, references);
4772new MetadataReference[] { },
4806void verify(MetadataReference reference0, MetadataReference reference1, MetadataReference reference2, string source, int namespaceOrdinalReferencedInUsings = 0)
4810AssertUsedAssemblyReferences(comp2, namespaceOrdinalReferencedInUsings switch { 1 => references, 2 => new[] { reference0, reference1 }, 3 => new[] { reference0 }, _ => new MetadataReference[] { } }, references);
4923var comp1ImageRef = comp1.EmitToImageReference();
5013var comp1ImageRef = comp1.EmitToImageReference();
5068var comp1ImageRef = comp1.EmitToImageReference();
5155var comp1ImageRef = comp1.EmitToImageReference();
5197var comp0ImageRef = comp0.EmitToImageReference();
5230var comp1ImageRef = comp1.EmitToImageReference();
5413var comp1ImageRef = comp1.EmitToImageReference();
5806MetadataReference comp0Ref = comp0.ToMetadataReference();
5807var comp0RefWithAlias = comp0Ref.WithAliases(new[] { "Alias0" });
5843MetadataReference comp0Ref = comp0.ToMetadataReference();
5844var comp0RefWithAlias = comp0Ref.WithAliases(new[] { "Alias0" });
5878MetadataReference comp0Ref = comp0.ToMetadataReference();
5879var comp0RefWithAlias = comp0Ref.WithAliases(new[] { "Alias0" });
5942new MetadataReference[] { },
5963new MetadataReference[] { },
Symbols\AssemblyAndNamespaceTests.cs (9)
118syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text) }, references: new MetadataReference[] { });
123references: new MetadataReference[] { compRef });
166references: new MetadataReference[] { compRef });
208var comp = CreateEmptyCompilation(new string[] { text3 }, references: new MetadataReference[] { compRef1, compRef2 }.ToList(), assemblyName: "Test3");
251var comp1 = CSharpCompilation.Create(assemblyName: "Test1", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1) }, references: new MetadataReference[] { });
252var comp2 = CSharpCompilation.Create(assemblyName: "Test2", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text2) }, references: new MetadataReference[] { });
259references: new MetadataReference[] { compRef1, compRef2 });
301references: new MetadataReference[] { });
413var libRef = libComp.EmitToImageReference(aliases: ImmutableArray.Create("myTask"));
Symbols\CompilationCreationTests.cs (41)
72var c1 = CSharpCompilation.Create("Test", references: new MetadataReference[] { MscorlibRef_v4_0_30316_17626, mdTestLib1 });
230var asm4 = MetadataTestHelpers.GetSymbolsForReferences(new MetadataReference[]
716new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib1_V1.ToMetadataReference() });
725new MetadataReference[]
770new MetadataReference[] { NetFramework.mscorlib });
803new MetadataReference[]
818new MetadataReference[]
896new MetadataReference[] { NetFramework.mscorlib });
942new MetadataReference[] { NetFramework.mscorlib,
954new MetadataReference[]
1059new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib3.ToMetadataReference() });
1068new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib2.ToMetadataReference() });
1077new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib2.ToMetadataReference(), varC_MTTestLib3.ToMetadataReference(), varC_MTTestLib4.ToMetadataReference() });
1145new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib4.ToMetadataReference(), varC_MTTestLib2.ToMetadataReference(), varC_MTTestLib3.ToMetadataReference() });
1159new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib4.ToMetadataReference() });
1168new MetadataReference[] {
1432new MetadataReference[] {
1470new MetadataReference[]
1487new MetadataReference[]
1555new MetadataReference[]
1575new MetadataReference[] {
1680new MetadataReference[] {
1692new MetadataReference[] {
1704new MetadataReference[] {
1781new MetadataReference[] {
1800new MetadataReference[] {
1812new MetadataReference[] {
2107new MetadataReference[] { NetFramework.mscorlib });
2122new MetadataReference[] { NetFramework.mscorlib });
2137new MetadataReference[] { NetFramework.mscorlib });
2152new MetadataReference[] { NetFramework.mscorlib });
2234new MetadataReference[] { NetFramework.mscorlib,
2254new MetadataReference[] {
2549var c1 = CreateEmptyCompilation(text, new MetadataReference[]
2558var c2 = CreateCompilation(c2_Name, null, new MetadataReference[]
2652return ImmutableArray.Create(MetadataReference.CreateFromFile(_data));
2655return ImmutableArray.Create(MetadataReference.CreateFromFile(_core));
2658return ImmutableArray.Create(MetadataReference.CreateFromFile(_system));
2663return ImmutableArray.Create(MetadataReference.CreateFromFile(reference));
2764return ImmutableArray.Create(MetadataReference.CreateFromFile(path, properties));
2973var ref1 = lib1.EmitToImageReference(); // NOTE: can't use a compilation reference for a module.
Symbols\CovariantReturnTests.cs (54)
24private static readonly MetadataReference CorelibraryWithCovariantReturnSupport1;
25private static readonly MetadataReference CorelibraryWithCovariantReturnSupport2;
26private static readonly MetadataReference CorelibraryWithoutCovariantReturnSupport1;
27private static readonly MetadataReference CorelibraryWithoutCovariantReturnSupport2;
28private static readonly MetadataReference CorelibraryWithCovariantReturnSupportButWithoutPreserveBaseOverridesAttribute;
398MetadataReference[] references = null,
417MetadataReference[] references = null,
437MetadataReference[] references = null,
457MetadataReference[] references = null,
462var coreLibrary = comp.GetMetadataReference(comp.Assembly.CorLibrary);
478MetadataReference[] references = null,
482var compAsImage = comp.EmitToImageReference();
484var coreLibrary = comp.GetMetadataReference(comp.Assembly.CorLibrary);
495MetadataReference[] references = null,
503var coreLibrary = comp.GetMetadataReference(comp.Assembly.CorLibrary);
504MetadataReference alternateCorlib =
1413var baseMetadata = CreateCompilationWithCovariantReturns(s0).EmitToImageReference();
1475var baseMetadata = CreateCompilationWithCovariantReturns(s0).EmitToImageReference();
1539var baseMetadata = CreateCompilationWithCovariantReturns(s0).EmitToImageReference();
2578var csRef = csComp.EmitToImageReference();
2811var ref0 = CreateCompilationWithoutCovariantReturns(s0).EmitToImageReference();
2818var ref1a = CreateCompilationWithoutCovariantReturns(
2829var ref1b = CreateCompilationWithCovariantReturns(
2905var ref0 = CreateCompilationWithoutCovariantReturns(s0).EmitToImageReference();
2912var ref1a = CreateCompilationWithoutCovariantReturns(s1a, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference();
2920var ref1b = CreateCompilationWithCovariantReturns(s1b, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference();
2972var ref0 = CreateCompilationWithoutCovariantReturns(s0).EmitToImageReference();
2979var ref1a = CreateCompilationWithoutCovariantReturns(s1a, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference();
2987var ref1b = CreateCompilationWithCovariantReturns(s1b, references: new[] { ref0 }, assemblyName: "ref1").EmitToImageReference();
3746MetadataReference ilReference = CreateMetadataReferenceFromIlSource(ilSource, prependDefaultHeader: false);
3825var corlibRef = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport1 : CorelibraryWithoutCovariantReturnSupport1;
3826var corlib2Ref = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport2 : CorelibraryWithoutCovariantReturnSupport2;
3865MetadataReference[] references;
3866MetadataReference[] retargetReferences;
3944var corlibRef = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport1 : CorelibraryWithoutCovariantReturnSupport1;
3945var corlib2Ref = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport2 : CorelibraryWithoutCovariantReturnSupport2;
3988MetadataReference[] references;
3989MetadataReference[] retargetReferences;
4068var corlibRef = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport1 : CorelibraryWithoutCovariantReturnSupport1;
4069var corlib2Ref = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport2 : CorelibraryWithoutCovariantReturnSupport2;
4108MetadataReference[] references;
4109MetadataReference[] retargetReferences;
4183var corlibRef = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport1 : CorelibraryWithoutCovariantReturnSupport1;
4184var corlib2Ref = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport2 : CorelibraryWithoutCovariantReturnSupport2;
4222MetadataReference[] references;
4223MetadataReference[] retargetReferences;
4304var corlibRef = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport1 : CorelibraryWithoutCovariantReturnSupport1;
4305var corlib2Ref = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport2 : CorelibraryWithoutCovariantReturnSupport2;
4331MetadataReference[] references;
4332MetadataReference[] retargetReferences;
4410var corlibRef = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport1 : CorelibraryWithoutCovariantReturnSupport1;
4411var corlib2Ref = withCovariantCapableRuntime ? CorelibraryWithCovariantReturnSupport2 : CorelibraryWithoutCovariantReturnSupport2;
4494MetadataReference[] references;
4495MetadataReference[] retargetReferences;
Symbols\DefaultInterfaceImplementationTests.cs (134)
166foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
1676foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
1742foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
2265foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
2334foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
2407foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
2480foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
9280foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
9470foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
9992foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
11755foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() })
11905foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12020foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12143foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12234foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12296foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12358foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12635foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12723foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
12811foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
14956foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
15135foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
15261foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
15862foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
18326foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
18492foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
20424foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() })
28499foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
28640foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
28765foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
29374foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
31166foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() })
32022foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() })
32156foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() })
32547foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() })
34461foreach (var ref1 in refs1)
34538foreach (var ref2 in refs2)
35467foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
35576foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
35689foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
35802foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
35908foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36013foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36111foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36225foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36402foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36427foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
36590foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36615foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
36778foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
36803foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
38418foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
38444foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
38798foreach (var ref1 in refs1)
38878foreach (var ref2 in refs2)
41460foreach (var ref1 in refs1)
41540foreach (var ref2 in refs2)
42037foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
42064foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
42241foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
42268foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
42445foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
42472foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() })
44220foreach (var reference in references)
44266foreach (var reference in references)
46032foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() })
46158foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
46301foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
46596MetadataReference metadataReference = compilation1.EmitToImageReference();
47229MetadataReference metadataReference = compilation1.EmitToImageReference();
47321MetadataReference metadataReference = compilation1.EmitToImageReference();
47397MetadataReference metadataReference = compilation1.EmitToImageReference();
47527MetadataReference metadataReference = compilation1.EmitToImageReference();
47608MetadataReference metadataReference = compilation1.EmitToImageReference();
47682MetadataReference metadataReference0 = compilation0.EmitToImageReference();
47714MetadataReference metadataReference3 = compilation3.EmitToImageReference();
47743MetadataReference metadataReference6 = compilation6.EmitToImageReference();
47815MetadataReference metadataReference0 = compilation0.EmitToImageReference();
47847MetadataReference metadataReference3 = compilation3.EmitToImageReference();
47876MetadataReference metadataReference6 = compilation6.EmitToImageReference();
47943MetadataReference metadataReference = compilation1.EmitToImageReference();
48010MetadataReference metadataReference = compilation1.EmitToImageReference();
48086MetadataReference metadataReference = compilation1.EmitToImageReference();
48143MetadataReference metadataReference = compilation1.EmitToImageReference();
48210MetadataReference metadataReference = compilation1.EmitToImageReference();
48307MetadataReference metadataReference = compilation1.EmitToImageReference();
48377MetadataReference metadataReference = compilation1.EmitToImageReference();
48441MetadataReference metadataReference = compilation1.EmitToImageReference();
48520MetadataReference metadataReference = compilation1.EmitToImageReference();
48592MetadataReference metadataReference = compilation1.EmitToImageReference();
48664MetadataReference metadataReference = compilation1.EmitToImageReference();
48734MetadataReference metadataReference = compilation1.EmitToImageReference();
48897MetadataReference metadataReference = compilation1.EmitToImageReference();
48963MetadataReference metadataReference = compilation1.EmitToImageReference();
49070MetadataReference metadataReference = compilation1.EmitToImageReference();
49302MetadataReference metadataReference = compilation1.EmitToImageReference();
49542MetadataReference metadataReference = compilation1.EmitToImageReference();
49658foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
49774foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
50575foreach (var reference in new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true), piaCompilation.EmitToImageReference(embedInteropTypes: true) })
50620foreach (var reference in new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true), piaCompilation.EmitToImageReference(embedInteropTypes: true) })
50682IEnumerable<MetadataReference> baseReferences = TargetFrameworkUtil.GetReferencesWithout(TargetFramework.Net50, "System.Runtime.InteropServices.dll");
50684var attributesRef = attributes.EmitToImageReference();
50750var pia2Reference = pia2Compilation.EmitToImageReference();
50755foreach (var reference2 in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
50805foreach (var reference in new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true), piaCompilation.EmitToImageReference(embedInteropTypes: true) })
51068foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
51235foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
51379foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
51516foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
51663foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
51803foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
51909foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
52508foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
52704foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
52865foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
53032foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
53204foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
53366foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
53501foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
54198foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
57486foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
57662foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
57816foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
57971foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
58130foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
58279foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
58403foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
59250foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
66749foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
66929foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
68189foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
68864foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
68949foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
Symbols\IndexedPropertyTests.cs (33)
47var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
109var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
207var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
290var reference1 = CompileIL(source1);
575var reference1 = CompileIL(source1);
692var reference1 = CompileIL(source1);
848var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
959var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1074var reference1 = CompileIL(source1);
1173var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
1209var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
1255var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1304var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1353var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1395var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1479var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1541var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Skipped);
1620var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1691var reference2 = MetadataReference.CreateFromImage(compilation2.EmittedAssemblyData);
1811var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1898var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
1957var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
2045var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
2104var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Skipped);
2139var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
2163var reference1 = CompileIL(source1);
2179var reference2 = BasicCompilationUtils.CompileToMetadata(source2, references: new[] { MscorlibRef, reference1 });
2237var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
2309var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
2386var reference1 = BasicCompilationUtils.CompileToMetadata(source1, verify: Verification.Passes);
2620var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
2693var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
2752var reference1 = BasicCompilationUtils.CompileToMetadata(source1);
Symbols\Metadata\PE\NoPia.cs (36)
649var assemblies9 = MetadataTestHelpers.GetSymbolsForReferences(new MetadataReference[]
692var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
695var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
762var tc1 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, pia5Link });
772var tc2 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, pia5Ref });
782var tc3 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref });
796var tc4 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Ref, pia1Ref });
812var tc5 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Link });
830var tc6 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref });
843var tc7 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, library2Link, pia5Link, pia1Ref });
882var tc1 = CSharpCompilation.Create("C1", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef, varBLink });
888var tc2 = CSharpCompilation.Create("C2", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef, varDRef, varBLink });
896var tc3 = CSharpCompilation.Create("C3", references: new MetadataReference[] { varmscorlibRef, varCRef, varBLink });
901var tc4 = CSharpCompilation.Create("C4", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef, varBRef });
911var tc5 = CSharpCompilation.Create("C5", references: new MetadataReference[] { varmscorlibRef, varCRef, varALink, varBLink });
922var tc6 = CSharpCompilation.Create("C6", references: new MetadataReference[] { varmscorlibRef, varARef, varBLink, varCLink });
933var tc7 = CSharpCompilation.Create("C7", references: new MetadataReference[] { varmscorlibRef, varCRef, varARef });
1122var varC_Library2 = CSharpCompilation.Create("Library2", new[] { Parse(library2Source) }, new MetadataReference[] { mscorlibRef, pia1Ref, pia5Ref });
1129var tc1 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, pia5Link });
1139var tc2 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, pia5Ref });
1149var tc3 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref });
1163var tc4 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Ref, pia1Ref });
1179var tc5 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Link });
1197var tc6 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Ref, pia5Link, pia1Ref });
1210var tc7 = CSharpCompilation.Create("C1", new SyntaxTree[0], new MetadataReference[] { mscorlibRef, library2Link, pia5Link, pia1Ref });
1277var varC_C = CSharpCompilation.Create("C", references: new MetadataReference[] { mscorlibRef, varARef, varBRef });
1282var varC_D = CSharpCompilation.Create("D", references: new MetadataReference[] { mscorlibRef });
1287var tc1 = CSharpCompilation.Create("C1", references: new MetadataReference[] { mscorlibRef, varCRef, varARef, varBLink });
1293var tc2 = CSharpCompilation.Create("C2", references: new MetadataReference[] { mscorlibRef, varCRef, varARef, varDRef, varBLink });
1301var tc3 = CSharpCompilation.Create("C3", references: new MetadataReference[] { mscorlibRef, varCRef, varBLink });
1306var tc4 = CSharpCompilation.Create("C4", references: new MetadataReference[] { mscorlibRef, varCRef, varARef, varBRef });
1316var tc5 = CSharpCompilation.Create("C5", references: new MetadataReference[] { mscorlibRef, varCRef, varALink, varBLink });
1327var tc6 = CSharpCompilation.Create("C6", references: new MetadataReference[] { mscorlibRef, varARef, varBLink, varCLink });
1338var tc7 = CSharpCompilation.Create("C7", references: new MetadataReference[] { mscorlibRef, varCRef, varARef });
1385var referencePIAImage = compilationPIA.EmitToImageReference(embedInteropTypes: true);
1391var referenceBaseImage = compilationBase.EmitToImageReference();
Symbols\Metadata\PE\TypeForwarders.cs (52)
166var ref1 = CompileIL(il1, prependDefaultHeader: false);
167var ref2 = CompileIL(il2, prependDefaultHeader: false);
168var ref3 = CompileIL(il3, prependDefaultHeader: false);
230var ref1 = CompileIL(il1, prependDefaultHeader: false);
231var ref2 = CompileIL(il2, prependDefaultHeader: false);
303var ref1 = CompileIL(il1, prependDefaultHeader: false);
304var ref2 = CompileIL(il2, prependDefaultHeader: false);
305var ref3 = CompileIL(il3, prependDefaultHeader: false);
401var ref1 = CompileIL(il1, prependDefaultHeader: false);
402var ref2 = CompileIL(il2, prependDefaultHeader: false);
403var ref3 = CompileIL(il3, prependDefaultHeader: false);
404var ref4 = CompileIL(il4, prependDefaultHeader: false);
510var ref1 = CompileIL(il1, prependDefaultHeader: false);
511var ref2 = CompileIL(il2, prependDefaultHeader: false);
512var ref3 = CompileIL(il3, prependDefaultHeader: false);
567var ref1 = CompileIL(il1, prependDefaultHeader: false);
568var ref2 = CompileIL(il2, prependDefaultHeader: false);
631var ref1 = CompileIL(il1, prependDefaultHeader: false);
632var ref2 = CompileIL(il2, prependDefaultHeader: false);
700var ref1 = CompileIL(il1, prependDefaultHeader: false);
701var ref2 = CompileIL(il2, prependDefaultHeader: false);
750var ref1 = CompileIL(il1, prependDefaultHeader: false);
751var ref2 = CompileIL(il2, prependDefaultHeader: false);
800var ref1 = CompileIL(il1, prependDefaultHeader: false);
855var ref1 = CompileIL(il1, prependDefaultHeader: false);
896var ref1 = CompileIL(il1, prependDefaultHeader: false);
943var ref1 = CompileIL(il1, prependDefaultHeader: false);
979var ref1 = CompileIL(il1, prependDefaultHeader: false);
1049var ref1 = CompileIL(il1, prependDefaultHeader: false);
1143var ref1 = CompileIL(il1, prependDefaultHeader: false);
1207var ref1 = CompileIL(il1, prependDefaultHeader: false);
1464var ref1 = MetadataReference.CreateFromImage(verifier1.EmittedAssemblyData);
1538var refA = MetadataReference.CreateFromImage(bitsA);
1619var modRef1 = modCompilation.EmitToImageReference();
1682var modRef2 = GetILModuleReference(ilSource, prependDefaultHeader: false);
1684appCompilation = CreateCompilation(app, references: new MetadataReference[] { modRef2, new CSharpCompilationReference(forwardedTypesCompilation) }, options: TestOptions.ReleaseDll);
1835var cB_ImageRef = cB.EmitToImageReference();
1843var cC_v1_ImageRef = cC_v1.EmitToImageReference();
1849var cA_v2_ImageRef = cA_v2.EmitToImageReference();
1855var cD_ImageRef = cD.EmitToImageReference();
1865var ref1 = new MetadataReference[]
1872var ref2 = new MetadataReference[]
1878var ref3 = new MetadataReference[]
1885foreach (var r1 in ref1)
1887foreach (var r2 in ref2)
1889foreach (var r3 in ref3)
1919var refA1 = compA1.EmitToImageReference(aliases: ImmutableArray.Create("A"));
1923var refB1 = compB1.EmitToImageReference(aliases: ImmutableArray.Create("B"));
1946var refBImpl = compBImpl.EmitToImageReference();
1983var refA1 = compA1.EmitToImageReference(aliases: ImmutableArray.Create("A"));
1987var refB1 = compB1.EmitToImageReference(aliases: ImmutableArray.Create("B"));
2010var refBImpl = compBImpl.EmitToImageReference();
Symbols\Retargeting\NoPia.cs (96)
291new MetadataReference[] { MscorlibRef });
360new MetadataReference[] {
402new MetadataReference[] {
433new MetadataReference[] { TestReferences.SymbolsTests.NoPia.Pia1 },
477new MetadataReference[] {
490new MetadataReference[] {
526new MetadataReference[] {
555new MetadataReference[] {
585new MetadataReference[] {
617new MetadataReference[] {
627new MetadataReference[] {
661new MetadataReference[] {
703new MetadataReference[] {
734new MetadataReference[] { TestReferences.SymbolsTests.NoPia.Pia1 },
778new MetadataReference[] {
791new MetadataReference[] {
827new MetadataReference[] {
856new MetadataReference[] {
886new MetadataReference[] {
918new MetadataReference[] {
928new MetadataReference[] {
955references: new MetadataReference[] { new CSharpCompilationReference(Pia1, embedInteropTypes: true) });
960references: new MetadataReference[] { new CSharpCompilationReference(Pia1, embedInteropTypes: true) });
965new MetadataReference[] {
1007new MetadataReference[] {
1038new MetadataReference[] { TestReferences.SymbolsTests.NoPia.Pia1 },
1082new MetadataReference[] {
1095new MetadataReference[] {
1131new MetadataReference[] {
1160new MetadataReference[] {
1190new MetadataReference[] {
1222new MetadataReference[] {
1232new MetadataReference[] {
1263var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
1266var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
1289var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
1292var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
1314references: new MetadataReference[] { new CSharpCompilationReference(Pia1, embedInteropTypes: true) });
1319var tc1 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
1322var tc2 = CSharpCompilation.Create("Cyclic1", references: new MetadataReference[] { mscorlibRef, cyclic2Ref, piaRef, localTypes1Ref });
1341new MetadataReference[]
1362new MetadataReference[]
1412new MetadataReference[] { },
1420new MetadataReference[] { comp.ToMetadataReference() },
1457new MetadataReference[] { },
1465new MetadataReference[] { comp.ToMetadataReference() },
1533references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) });
1537references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) });
1587references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) });
1591references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) });
1640references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) });
1644references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) });
1682references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) });
1686references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) });
1737references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) });
1741references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true) });
1805references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true), lib.ToMetadataReference() });
1809references: new MetadataReference[] { pia.EmitToImageReference(embedInteropTypes: true), lib.EmitToImageReference() });
1850references: new MetadataReference[] { new CSharpCompilationReference(pia).WithEmbedInteropTypes(true) });
1867references: new MetadataReference[] { MetadataReference.CreateFromImage(pia.EmitToArray()).WithEmbedInteropTypes(true) });
1894new MetadataReference[]
1915new MetadataReference[]
1938references: new MetadataReference[] { new CSharpCompilationReference(Pia1, embedInteropTypes: true) });
1944new MetadataReference[]
1965new MetadataReference[]
2018var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray());
2044var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray());
2047references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2062references: new MetadataReference[] {localTypes2Image,
2077references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2092references: new MetadataReference[] {localTypes2Image,
2143var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray());
2169var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray());
2172references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2187references: new MetadataReference[] {localTypes2Image,
2202references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2217references: new MetadataReference[] {localTypes2Image,
2268var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray());
2294var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray());
2297references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2312references: new MetadataReference[] {localTypes2Image,
2327references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2342references: new MetadataReference[] {localTypes2Image,
2404references: new MetadataReference[] { new CSharpCompilationReference(pia, embedInteropTypes: true) });
2406var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray());
2409references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2424references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2476var localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray());
2502var piaImage = MetadataReference.CreateFromImage(pia.EmitToArray());
2505references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2520references: new MetadataReference[] {localTypes2Image,
2535references: new MetadataReference[] {new CSharpCompilationReference(localTypes2),
2550references: new MetadataReference[] {localTypes2Image,
2663foreach (MetadataReference piaRef in new[] { piaCompilation.EmitToImageReference(), piaCompilation.ToMetadataReference() })
2667foreach (MetadataReference consumer1Ref in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
Symbols\Retargeting\RetargetingTests.cs (5)
969var ilRef = CompileIL(ilSource);
1048var beforeRetargeting = CreateCompilation(originalIdentity, new[] { corlibSource }, new MetadataReference[0]);
1062var afterRetargeting = CreateCompilation(originalIdentity.WithVersion(new Version(2, 0, 0, 0)), new[] { corlibSource }, new MetadataReference[0]);
1126var beforeRetargeting = CreateCompilation(originalIdentity, new[] { corlibSource }, new MetadataReference[0]);
1139var afterRetargeting = CreateCompilation(originalIdentity.WithVersion(new Version(2, 0, 0, 0)), new[] { corlibSource }, new MetadataReference[0]);
Symbols\Source\ClsComplianceTests.cs (21)
495var lib1 = CreateCompilation(libSource1, assemblyName: "lib1", parseOptions: TestOptions.Regular11).EmitToImageReference();
496var lib2 = CreateCompilation(libSource2, assemblyName: "lib2", parseOptions: TestOptions.Regular11).EmitToImageReference();
497var lib3 = CreateCompilation(libSource3, assemblyName: "lib3", parseOptions: TestOptions.Regular11).EmitToImageReference();
561var lib1 = CreateCompilation(libSource1, assemblyName: "lib1", options: TestOptions.UnsafeDebugDll).EmitToImageReference();
562var lib2 = CreateCompilation(libSource2, assemblyName: "lib2", options: TestOptions.UnsafeDebugDll).EmitToImageReference();
563var lib3 = CreateCompilation(libSource3, assemblyName: "lib3", options: TestOptions.UnsafeDebugDll).EmitToImageReference();
643var libCompliant = CreateCompilationWithMscorlib46(libCompliant_cs).EmitToImageReference();
651var libNotCompliant = CreateCompilationWithMscorlib46(libNotCompliant_cs).EmitToImageReference();
2366var trueModuleRef = CreateCompilation("[assembly:System.CLSCompliant(true)][module:System.CLSCompliant(true)]", options: TestOptions.ReleaseModule, assemblyName: "true").EmitToImageReference();
2367var falseModuleRef = CreateCompilation("[assembly:System.CLSCompliant(false)][module:System.CLSCompliant(false)]", options: TestOptions.ReleaseModule, assemblyName: "false").EmitToImageReference();
2368var noneModuleRef = CreateCompilation("", options: TestOptions.ReleaseModule, assemblyName: "none").EmitToImageReference();
2401var trueModuleRef = CreateCompilation("[assembly:System.CLSCompliant(true)]", options: TestOptions.ReleaseModule, assemblyName: "true").EmitToImageReference();
2402var falseModuleRef = CreateCompilation("[assembly:System.CLSCompliant(false)]", options: TestOptions.ReleaseModule, assemblyName: "false").EmitToImageReference();
2403var noneModuleRef = CreateCompilation("", options: TestOptions.ReleaseModule, assemblyName: "none").EmitToImageReference();
2434var trueModuleRef = CreateCompilation("[assembly:System.CLSCompliant(true)][module:System.CLSCompliant(true)]", options: TestOptions.ReleaseModule, assemblyName: "true").EmitToImageReference();
2435var falseModuleRef = CreateCompilation("[assembly:System.CLSCompliant(false)][module:System.CLSCompliant(false)]", options: TestOptions.ReleaseModule, assemblyName: "false").EmitToImageReference();
3130var moduleRef = CreateCompilation(moduleSource, assemblyName: "module").EmitToImageReference(expectedWarnings: new[]
3459var libRef = CreateCompilation(libSource).EmitToImageReference();
3646var libRef = CreateCompilation(libSource).EmitToImageReference();
3708var libRef = CompileIL(libIL, prependDefaultHeader: false);
3756var libRef = CreateCompilation(libSource, assemblyName: "lib").EmitToImageReference();
Symbols\Source\CustomModifierCopyTests.cs (28)
49var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
92var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
143var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
192var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
254var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
319var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
355var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
409var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
518var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
587var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
690var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
723var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
764var comp = CreateCompilation(text, new MetadataReference[] { ilAssemblyReference });
957var ilRef = CompileIL(il, prependDefaultHeader: false);
1001var ilRef = CompileIL(il, prependDefaultHeader: false);
1131var ilRef = CompileIL(il, prependDefaultHeader: false);
1278var ilRef = CompileIL(il, prependDefaultHeader: false);
1394var ilRef = CompileIL(il, prependDefaultHeader: false);
1434var ilRef = CompileIL(il, prependDefaultHeader: false);
1479var ilRef = CompileIL(il, prependDefaultHeader: false);
1523var ilRef = CompileIL(il, prependDefaultHeader: false);
1578var ilRef = CompileIL(il, prependDefaultHeader: false);
1632var ilRef = CompileIL(il, prependDefaultHeader: false);
1682var ilRef = CompileIL(il, prependDefaultHeader: false);
1767var ilRef = CompileIL(il, prependDefaultHeader: false);
1884var ilRef = CompileIL(il, prependDefaultHeader: false);
1981var ilRef = CompileIL(il, prependDefaultHeader: false);
2083var ilRef = CompileIL(il, prependDefaultHeader: false);
Symbols\Source\MethodTests.cs (4)
758var comp2 = CreateCompilationWithMscorlib461(new string[] { text1 }, new List<MetadataReference>() { compRef1 }, assemblyName: "Test2");
764var comp = CreateCompilationWithMscorlib461(new string[] { text2 }, new List<MetadataReference>() { compRef1, compRef2 }, assemblyName: "Test3");
1047var comp2 = CreateCompilation(new string[] { text1 }, new List<MetadataReference>() { compRef1 }, assemblyName: "Test2");
1053var comp = CreateCompilation(new string[] { text2 }, new List<MetadataReference>() { compRef1, compRef2 }, assemblyName: "Test3");
Symbols\StaticAbstractMembersInInterfacesTests.cs (40)
16190foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
16671foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
16759foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
16851foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
16933foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
17015foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
17086foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
17160foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
17247foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
17346foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
17452foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
19918foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
19992foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
20075foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
20155foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21283foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21343foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21446foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21566foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21689foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21798foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
21900foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
23208foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
24769foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
24884foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
25011foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
25082foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
25895foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
27434foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
27549foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
27677foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
27748foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
28882foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
29507foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
29624foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
29730foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
33094foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
33161foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
33228foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
33295foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() })
Symbols\SymbolDistinguisherTests.cs (21)
33var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference();
98var libRef = MetadataReference.CreateFromImage(libComp.EmitToArray(), filePath: "Metadata.dll");
138var libRef = MetadataReference.CreateFromImage(libComp.EmitToArray(), filePath: "Metadata.dll");
158var libRef = CreateCompilation(source, assemblyName: "Metadata").EmitToImageReference();
182var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference();
208var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference();
233var libRef = CreateCompilation(tree, assemblyName: "Metadata", options: TestOptions.UnsafeReleaseDll).EmitToImageReference();
258var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference();
280var libRef = CreateCompilation(tree, assemblyName: "Metadata").EmitToImageReference();
297var libRef = CreateCompilation("public class dynamic { }", assemblyName: "Metadata").EmitToImageReference();
350var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
384var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
418var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
450var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
482var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
511var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
546var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
611var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
648var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
679var libRef = CreateCompilation(libSource, assemblyName: "Metadata").EmitToImageReference();
740var ref1 = compilation1.EmitToImageReference();
Symbols\SymbolErrorTests.cs (149)
143var comp = CreateCompilation(text, references: new MetadataReference[] { ref2 }, assemblyName: "Test3");
5494var comp = CreateCompilation(text, new List<MetadataReference> { ref1, ref2 });
5516comp = CreateCompilation(new SyntaxTree[] { Parse(text, "goo.cs") }, new List<MetadataReference> { ref1 });
5552var comp = DiagnosticsUtils.VerifyErrorsAndGetCompilationWithMscorlib(text, new List<MetadataReference> { ref1, ref2 },
5588new List<MetadataReference>()
5627new List<MetadataReference>()
5672new List<MetadataReference>()
5686new List<MetadataReference>()
5690MetadataReference.CreateFromImage(lib.EmitToArray())
5734new List<MetadataReference>()
5747new List<MetadataReference>()
5750MetadataReference.CreateFromImage(lib.EmitToArray())
5793new List<MetadataReference>()
5807new List<MetadataReference>()
5811MetadataReference.CreateFromImage(lib.EmitToArray())
5855new List<MetadataReference>()
5868new List<MetadataReference>()
5871MetadataReference.CreateFromImage(lib.EmitToArray())
5914new List<MetadataReference>()
5926new List<MetadataReference>()
5929MetadataReference.CreateFromImage(lib.EmitToArray())
5971new List<MetadataReference>()
5984new List<MetadataReference>()
5987MetadataReference.CreateFromImage(lib.EmitToArray())
6030new List<MetadataReference>()
6043new List<MetadataReference>()
6046MetadataReference.CreateFromImage(lib.EmitToArray())
6089new List<MetadataReference>()
6102new List<MetadataReference>()
6105MetadataReference.CreateFromImage(lib.EmitToArray())
6136new List<MetadataReference>()
6172new List<MetadataReference>()
6208new List<MetadataReference>()
6244new List<MetadataReference>()
6287new List<MetadataReference>()
6300new List<MetadataReference>()
6303MetadataReference.CreateFromImage(lib.EmitToArray())
6347new List<MetadataReference>()
6361new List<MetadataReference>()
6365MetadataReference.CreateFromImage(lib.EmitToArray())
6409new List<MetadataReference>()
6422new List<MetadataReference>()
6425MetadataReference.CreateFromImage(lib.EmitToArray())
6469new List<MetadataReference>()
6483new List<MetadataReference>()
6487MetadataReference.CreateFromImage(lib.EmitToArray())
6534new List<MetadataReference>()
6547new List<MetadataReference>()
6550MetadataReference.CreateFromImage(lib.EmitToArray())
6597new List<MetadataReference>()
6610new List<MetadataReference>()
6613MetadataReference.CreateFromImage(lib.EmitToArray())
6660new List<MetadataReference>()
6677new List<MetadataReference>()
6681MetadataReference.CreateFromImage(lib.EmitToArray())
6731new List<MetadataReference>()
6744new List<MetadataReference>()
6747MetadataReference.CreateFromImage(lib.EmitToArray())
6794new List<MetadataReference>()
6810new List<MetadataReference>()
6813MetadataReference.CreateFromImage(lib.EmitToArray())
6863new List<MetadataReference>()
6880new List<MetadataReference>()
6884MetadataReference.CreateFromImage(lib.EmitToArray())
6911var mod3Ref = CreateCompilation(mod3Source, options: TestOptions.ReleaseModule, assemblyName: "ErrTestMod03").EmitToImageReference();
6928new List<MetadataReference>()
6945new List<MetadataReference>()
6964new List<MetadataReference>()
6996var mod3Ref = CreateCompilation(mod3Source, options: TestOptions.ReleaseModule, assemblyName: "ErrTestMod03").EmitToImageReference();
7013new List<MetadataReference>()
7027new List<MetadataReference>()
7043new List<MetadataReference>()
7067var ModuleA01Ref = CreateCompilation(ModuleA01, options: TestOptions.ReleaseModule, assemblyName: "ModuleA01").EmitToImageReference();
7075var ModuleB01Ref = CreateCompilation(ModuleB01, options: TestOptions.ReleaseModule, assemblyName: "ModuleB01").EmitToImageReference();
7088new List<MetadataReference>()
7143new List<MetadataReference>()
7229var moduleRef2 = CreateCompilation(mod2Source, options: TestOptions.ReleaseModule, assemblyName: "mod_1_2").EmitToImageReference();
7232new List<MetadataReference>()
7271var forwardedTypesModRef = CreateCompilation(forwardedTypesSource,
7282var module1_FT1_Ref = CreateCompilation(modSource,
7285references: new MetadataReference[] { forwardedTypes1Ref }).
7288var module2_FT1_Ref = CreateCompilation(modSource,
7291references: new MetadataReference[] { forwardedTypes1Ref }).
7294var module3_FT2_Ref = CreateCompilation(modSource,
7297references: new MetadataReference[] { forwardedTypes2Ref }).
7300var module4_Ref = CreateCompilation("[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(CF3<int>))]",
7303references: new MetadataReference[] { forwardedTypes1Ref }).
7307new List<MetadataReference>()
7320new List<MetadataReference>()
7330new List<MetadataReference>()
7339new List<MetadataReference>()
7359new List<MetadataReference>()
7372new List<MetadataReference>()
7386new List<MetadataReference>()
7400new List<MetadataReference>()
7410new List<MetadataReference>()
10076var reference1 = CompileIL(source1);
10126var reference1 = CompileIL(source1);
10855var reference1 = CompileIL(source1);
12548var reference1 = CompileIL(source1);
13826var comp2 = CreateCompilation(text2, new MetadataReference[] { compRef1 });
14836var reference = SystemCoreRef;
14838new List<MetadataReference> { reference },
16208CreateCompilation(text, references: new MetadataReference[] { ref1 }).VerifyDiagnostics(
16438var ref1 = vbcomp.EmitToImageReference(embedInteropTypes: true);
17637var comp = CreateCompilation(new[] { text }, new List<MetadataReference> { ref1 });
17675var comp = CreateCompilation(new[] { text }, new List<MetadataReference> { ref1 });
17742var lib = CreateCompilation(tree, new MetadataReference[]
17823var lib = CreateCompilation(tree, new MetadataReference[]
17918var comp = CreateCompilation(new[] { text }, new List<MetadataReference> { ref1 });
19084var netModule = CreateEmptyCompilation("", options: TestOptions.ReleaseModule, assemblyName: "lib").EmitToImageReference(expectedWarnings: new[] { Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion) });
20540var ilReference = CompileIL(forwardingIL, prependDefaultHeader: false);
20557references: new MetadataReference[] { ilReference },
20683var referenceC = CreateCompilation(codeC, assemblyName: "C").EmitToImageReference();
20698var referenceB = CreateCompilation(codeB, references: new MetadataReference[] { referenceC }, assemblyName: "B").EmitToImageReference();
20714CreateCompilation(codeA, references: new MetadataReference[] { referenceB, referenceC }, assemblyName: "A").VerifyDiagnostics(); // No Errors
20730var referenceC2 = CompileIL(codeC2, prependDefaultHeader: false);
20732CreateCompilation(codeA, references: new MetadataReference[] { referenceB, referenceC2 }, assemblyName: "A").VerifyDiagnostics(
20747var referenceC = CreateCompilation(codeC, assemblyName: "C").EmitToImageReference();
20762var referenceB = CreateCompilation(codeB, references: new MetadataReference[] { referenceC }, assemblyName: "B").EmitToImageReference();
20780references: new MetadataReference[] { referenceB, referenceC },
20798var referenceC2 = CompileIL(codeC2, prependDefaultHeader: false);
20800CreateCompilation(codeA, references: new MetadataReference[] { referenceB, referenceC2 }).VerifyDiagnostics(
20810var referenceD = CreateCompilation(codeD, assemblyName: "D").EmitToImageReference();
20815references: new MetadataReference[] { referenceB, referenceC2, referenceD },
20847var ilModule = GetILModuleReference(ilSource, prependDefaultHeader: false);
20848CreateCompilation(string.Empty, references: new MetadataReference[] { ilModule }, assemblyName: "Forwarder").VerifyDiagnostics(
20867var ilModule = GetILModuleReference(ilSource, prependDefaultHeader: false);
20868CreateCompilation(string.Empty, references: new MetadataReference[] { ilModule }).VerifyDiagnostics(
20877var dReference = CreateCompilation(dCode, assemblyName: "D").EmitToImageReference();
20880CreateCompilation(string.Empty, references: new MetadataReference[] { ilModule, dReference }).VerifyDiagnostics();
20901var ilModuleReference = GetILModuleReference(ilSource, prependDefaultHeader: false);
20904references: new MetadataReference[] { ilModuleReference },
20922references: new MetadataReference[] { forwarderCompilation.ToMetadataReference() },
20950var module1Reference = GetILModuleReference(module1IL, prependDefaultHeader: false);
20965var module2Reference = GetILModuleReference(module2IL, prependDefaultHeader: false);
20969references: new MetadataReference[] { module1Reference, module2Reference },
20987references: new MetadataReference[] { forwarderCompilation.ToMetadataReference() },
21011var referenceC = CreateCompilation(codeC, assemblyName: "C").EmitToImageReference();
21026var referenceB = CreateCompilation(codeB, references: new MetadataReference[] { referenceC }, assemblyName: "B").EmitToImageReference();
21042var referenceC2 = CompileIL(codeC2, prependDefaultHeader: false);
21052var referenceD = CompileIL(codeD, prependDefaultHeader: false);
21053var referenceE = CreateCompilation(codeC, assemblyName: "E").EmitToImageReference();
21070CreateCompilation(codeA, references: new MetadataReference[] { referenceB, referenceC2, referenceD, referenceE }, assemblyName: "A").VerifyDiagnostics(
21576var comp2Ref = comp2.EmitToImageReference();
21671var comp2Ref = comp2.EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (71)
CSharpTestBase.cs (52)
662protected static MetadataReference RefSafetyRulesAttributeLib =>
799IEnumerable<MetadataReference> references = null,
835IEnumerable<MetadataReference> references = null,
872IEnumerable<MetadataReference> references = null,
913IEnumerable<MetadataReference> references = null,
949IEnumerable<MetadataReference> references = null,
985IEnumerable<MetadataReference> references = null,
1121IEnumerable<MetadataReference> references = null,
1130IEnumerable<MetadataReference> references = null,
1135MetadataReference ilReference = CompileIL(ilSource, appendDefaultHeader);
1142IEnumerable<MetadataReference> references = null,
1150IEnumerable<MetadataReference> references = null,
1159IEnumerable<MetadataReference> references = null,
1168IEnumerable<MetadataReference> references = null,
1177IEnumerable<MetadataReference> references = null,
1186IEnumerable<MetadataReference> references = null,
1194IEnumerable<MetadataReference> references = null,
1202IEnumerable<MetadataReference> references = null,
1210IEnumerable<MetadataReference> references = null,
1218IEnumerable<MetadataReference> references = null,
1226IEnumerable<MetadataReference> references = null,
1239IEnumerable<MetadataReference> references = null,
1245IEnumerable<MetadataReference> allReferences;
1266IEnumerable<MetadataReference> references = null,
1279IEnumerable<MetadataReference> references = null,
1289IEnumerable<MetadataReference> references,
1399static void assertSubset(ImmutableArray<MetadataReference> used, IEnumerable<MetadataReference> resolvedReferences)
1401foreach (var reference in used)
1438IEnumerable<MetadataReference> references,
1455IEnumerable<MetadataReference> references = null,
1474private static readonly ImmutableArray<MetadataReference> s_scriptRefs = ImmutableArray.Create(MscorlibRef_v4_0_30316_17626);
1478IEnumerable<MetadataReference> references = null,
1512MetadataReference reference = CreateMetadataReferenceFromIlSource(ilSource);
1520public static MetadataReference CreateMetadataReferenceFromIlSource(string ilSource, bool prependDefaultHeader = true)
1524return MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path));
2146MetadataReference[] references = null,
2167MetadataReference[] references = null,
2185MetadataReference[] references = null,
2204MetadataReference[] references = null,
2225MetadataReference[] references = null)
2237protected static MetadataReference VerifyOperationTreeAndDiagnosticsForTestWithIL<TSyntaxNode>(string testSrc,
2243MetadataReference[] references = null,
2248var ilReference = CreateMetadataReferenceFromIlSource(ilSource);
2278references: new List<MetadataReference>() { NetFramework.mscorlib, NetFramework.SystemCore, NetFramework.MicrosoftCSharp },
2285references: new List<MetadataReference>() { NetFramework.mscorlib, NetFramework.SystemCore, NetFramework.MicrosoftCSharp, reference.EmitToImageReference() },
2297references: new List<MetadataReference>() { MscorlibRef_v4_0_30316_17626, SystemCoreRef, CSharpRef },
2312references: new List<MetadataReference>() { reference.EmitToImageReference() },
2323references: new List<MetadataReference>() { reference.EmitToImageReference() },
2334references: new List<MetadataReference>() { reference.EmitToImageReference() },
2351references: new List<MetadataReference>() { reference.EmitToImageReference() },
2369references: new List<MetadataReference>() { reference.EmitToImageReference() },
MockCSharpCompiler.cs (3)
21private readonly ImmutableArray<MetadataReference> _additionalReferences;
27public MockCSharpCompiler(string responseFile, string workingDirectory, string[] args, ImmutableArray<DiagnosticAnalyzer> analyzers = default, ImmutableArray<ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null, ImmutableArray<MetadataReference> additionalReferences = default)
32public MockCSharpCompiler(string responseFile, BuildPaths buildPaths, string[] args, ImmutableArray<DiagnosticAnalyzer> analyzers = default, ImmutableArray<ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null, GeneratorDriverCache driverCache = null, ImmutableArray<MetadataReference> additionalReferences = default)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (38)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
Microsoft.CodeAnalysis.EditorFeatures (6)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (5)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (16)
EEMetadataReferenceResolver.cs (7)
14private readonly IReadOnlyDictionary<string, ImmutableArray<(AssemblyIdentity Identity, MetadataReference Reference)>> _referencesBySimpleName;
23IReadOnlyDictionary<string, ImmutableArray<(AssemblyIdentity Identity, MetadataReference Reference)>> referencesBySimpleName)
31public override PortableExecutableReference? ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity)
33(AssemblyIdentity? Identity, MetadataReference? Reference) result = default;
57private (AssemblyIdentity? Identity, MetadataReference? Reference) GetBestMatch(
58ImmutableArray<(AssemblyIdentity Identity, MetadataReference Reference)> references,
61(AssemblyIdentity? Identity, MetadataReference? Reference) best = default;
Microsoft.CodeAnalysis.Features (15)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Microsoft.CodeAnalysis.Rebuild (10)
Microsoft.CodeAnalysis.Rebuild.UnitTests (5)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.Scripting (27)
Microsoft.CodeAnalysis.Scripting.TestUtilities (6)
Microsoft.CodeAnalysis.Scripting.UnitTests (14)
Microsoft.CodeAnalysis.Test.Utilities (206)
AssemblyLoadTestFixture.cs (15)
194var delta1Reference = MetadataReference.CreateFromFile(Delta1);
225var delta2Reference = MetadataReference.CreateFromFile(Delta2);
245GammaReferencingPublicSigned = GenerateDll("GammaReferencingPublicSigned", _directory.CreateDirectory("GammaReferencingPublicSigned"), GammaSource, MetadataReference.CreateFromFile(DeltaPublicSigned1));
247var gammaReference = MetadataReference.CreateFromFile(Gamma);
301EpsilonReferencingPublicSigned = GenerateDll("EpsilonReferencingPublicSigned", v2PublicSignedDirectory, EpsilonSource, MetadataReference.CreateFromFile(DeltaPublicSigned2));
342var compilerReference = MetadataReference.CreateFromFile(typeof(Microsoft.CodeAnalysis.SyntaxNode).Assembly.Location);
361var userSystemCollectionsImmutableReference = MetadataReference.CreateFromFile(UserSystemCollectionsImmutable);
403", MetadataReference.CreateFromFile(delta1InAnalyzerReferencesDelta1.Path), compilerReference);
416var realSciReference = MetadataReference.CreateFromFile(typeof(ImmutableArray).Assembly.Location);
440}", realSciReference, compilerReference, MetadataReference.CreateFromFile(AnalyzerDependency));
478var fakeCompilerReference = MetadataReference.CreateFromFile(fakeCompilerAssembly);
506var laterCompilerReference = MetadataReference.CreateFromFile(laterFakeCompilerAssembly);
516private static string GenerateDll(string assemblyName, TempDirectory directory, string csSource, params MetadataReference[] additionalReferences)
521private static string GenerateDll(string assemblyName, TempDirectory directory, string csSource, ImmutableArray<byte> publicKeyOpt, params MetadataReference[] additionalReferences)
533references: (new MetadataReference[]
CommonTestBase.cs (18)
244internal static MetadataReference CompileIL(string ilSource, bool prependDefaultHeader = true, bool embedInteropTypes = false, bool autoInherit = true)
250internal static MetadataReference GetILModuleReference(string ilSource, bool prependDefaultHeader = true)
265IEnumerable<MetadataReference> referencedAssemblies = null)
275IEnumerable<MetadataReference> referencedAssemblies = null,
292IEnumerable<MetadataReference> referencedAssemblies = null)
302IEnumerable<MetadataReference> referencedAssemblies = null,
319IEnumerable<MetadataReference> referencedAssemblies = null)
329IEnumerable<MetadataReference> referencedAssemblies = null,
340IEnumerable<MetadataReference> referencedAssemblies = null,
352IEnumerable<MetadataReference> referencedAssemblies = null,
371var references = new List<MetadataReference>();
405IEnumerable<MetadataReference> referencedAssemblies = null)
415IEnumerable<MetadataReference> referencedAssemblies = null)
425IEnumerable<MetadataReference> referencedAssemblies = null,
436IEnumerable<MetadataReference> referencedAssemblies = null,
458var references = new List<MetadataReference>();
484private void AddReferencedCompilations(IEnumerable<Compilation> referencedCompilations, List<MetadataReference> references)
495internal static MetadataReference AsReference(Compilation comp, bool useCompilationReference)
Mocks\TestMessageProvider.cs (4)
258public override void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
263public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
Microsoft.CodeAnalysis.UnitTests (50)
MetadataReferences\MetadataReferenceTests.cs (34)
35Assert.Throws<NotSupportedException>(() => MetadataReference.CreateFromAssemblyInternal(dynamicAssembly));
39Assert.Throws<NotSupportedException>(() => MetadataReference.CreateFromAssemblyInternal(inMemoryAssembly));
45Assert.Throws<ArgumentNullException>(() => MetadataReference.CreateFromImage(null));
46Assert.Throws<ArgumentNullException>(() => MetadataReference.CreateFromImage(default));
47Assert.Throws<ArgumentNullException>(() => MetadataReference.CreateFromFile(null));
48Assert.Throws<ArgumentNullException>(() => MetadataReference.CreateFromFile(null, default(MetadataReferenceProperties)));
49Assert.Throws<ArgumentNullException>(() => MetadataReference.CreateFromStream(null));
51Assert.Throws<ArgumentNullException>(() => MetadataReference.CreateFromAssemblyInternal(null));
52Assert.Throws<ArgumentException>(() => MetadataReference.CreateFromAssemblyInternal(typeof(object).Assembly, new MetadataReferenceProperties(MetadataImageKind.Module)));
55Assert.Throws<NotSupportedException>(() => MetadataReference.CreateFromAssemblyInternal(dynamicAssembly));
65? MetadataReference.CreateFromImage(peImage.AsImmutable(), properties)
66: MetadataReference.CreateFromImage(peImage.AsEnumerable(), properties);
81? MetadataReference.CreateFromImage(peImage.AsImmutable(), MetadataReferenceProperties.Module)
82: MetadataReference.CreateFromImage(peImage.AsEnumerable(), MetadataReferenceProperties.Module);
98var r = MetadataReference.CreateFromStream(stream);
118var r = MetadataReference.CreateFromStream(new MemoryStream(TestResources.General.C1, writable: false));
129var r = MetadataReference.CreateFromStream(
145var r = MetadataReference.CreateFromStream(
163var r = MetadataReference.CreateFromFile(file.Path,
173Assert.Equal(props, MetadataReference.CreateFromFile(file.Path, props).Properties);
187var r = MetadataReference.CreateFromFile(file.Path, MetadataReferenceProperties.Module);
196Assert.Equal(props, MetadataReference.CreateFromFile(file.Path, props).Properties);
208var r = (PortableExecutableReference)MetadataReference.CreateFromAssemblyInternal(assembly);
217Assert.Equal(props, MetadataReference.CreateFromAssemblyInternal(assembly, props).Properties);
225var r = (PortableExecutableReference)MetadataReference.CreateFromAssemblyInternal(assembly, new MetadataReferenceProperties(MetadataImageKind.Assembly, ImmutableArray.Create("a", "b"), embedInteropTypes: true), documentation: doc);
431MetadataReference r;
433r = MetadataReference.CreateFromImage(TestResources.General.C1);
439r = MetadataReference.CreateFromImage(TestResources.General.C1, filePath: @"c:\blah");
526var f1 = MscorlibRef;
527var f2 = SystemCoreRef;
543var all = new MetadataReference[] { f1, f2, i1, i2, m1a, m1b, m2, c1a, c1b, c2 };
544foreach (var r in all)
546foreach (var s in all)
584var r = MetadataReference.CreateFromStream(new MemoryStream(TestResources.SymbolsTests.Metadata.InvalidPublicKey, writable: false));
Microsoft.CodeAnalysis.VisualBasic (43)
Errors\MessageProvider.vb (4)
386Public Overrides Sub ReportDuplicateMetadataReferenceStrong(diagnostics As DiagnosticBag, location As Location, reference As MetadataReference, identity As AssemblyIdentity, equivalentReference As MetadataReference, equivalentIdentity As AssemblyIdentity)
393Public Overrides Sub ReportDuplicateMetadataReferenceWeak(diagnostics As DiagnosticBag, location As Location, reference As MetadataReference, identity As AssemblyIdentity, equivalentReference As MetadataReference, equivalentIdentity As AssemblyIdentity)
Symbols\ReferenceManager.vb (11)
51Public Sub New(simpleAssemblyName As String, identityComparer As AssemblyIdentityComparer, observedMetadata As Dictionary(Of MetadataReference, MetadataOrDiagnostic))
121Protected Overrides Function CheckPropertiesConsistency(primaryReference As MetadataReference, duplicateReference As MetadataReference, diagnostics As DiagnosticBag) As Boolean
299Dim boundReferenceDirectiveMap As IDictionary(Of ValueTuple(Of String, String), MetadataReference) = Nothing
300Dim boundReferenceDirectives As ImmutableArray(Of MetadataReference) = Nothing
303Dim explicitReferences As ImmutableArray(Of MetadataReference) = Nothing
321Dim implicitlyResolvedReferences As ImmutableArray(Of MetadataReference) = Nothing
351Dim referencedAssembliesMap As Dictionary(Of MetadataReference, Integer) = Nothing
352Dim referencedModulesMap As Dictionary(Of MetadataReference, Integer) = Nothing
354Dim mergedAssemblyReferencesMapOpt As Dictionary(Of MetadataReference, ImmutableArray(Of MetadataReference)) = Nothing
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (80)
Attributes\AssemblyAttributes.vb (7)
1217Optional references As IEnumerable(Of MetadataReference) = Nothing,
1218Optional nameSuffix As String = "") As MetadataReference
1224Optional references As IEnumerable(Of MetadataReference) = Nothing,
1728Dim defsRef As MetadataReference = CreateCompilationWithMscorlib40({defaultHeaderString & s_defaultNetModuleSourceBody}, references:=Nothing, options:=TestOptions.ReleaseDll).ToMetadataReference()
1729Dim netmodule1Ref As MetadataReference = GetNetModuleWithAssemblyAttributesRef(source2, "", references:={defsRef}, nameSuffix:="1")
1740Dim netmodule2Ref As MetadataReference = GetNetModuleWithAssemblyAttributesRef(source1, "", references:={defsRef}, nameSuffix:="2")
1814Dim defsRef As MetadataReference = CreateCompilationWithMscorlib40({defaultImportsString & s_defaultNetModuleSourceBody}, references:=Nothing, options:=TestOptions.ReleaseDll).ToMetadataReference()
Attributes\InternalsVisibleToAndStrongNameTests.vb (7)
631</compilation>, {MetadataReference.CreateFromImage(otherImage)}, TestOptions.SigningReleaseDll, parseOptions:=parseOptions)
656</compilation>, {MetadataReference.CreateFromImage(otherImage)}, TestOptions.SigningReleaseDll, parseOptions:=parseOptions)
854</compilation>, {MetadataReference.CreateFromImage(other.EmitToArray())}, TestOptions.SigningReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithDelaySign(True), parseOptions:=parseOptions)
1690CompileAndVerify(other.WithReferences({other.References(0), MetadataReference.CreateFromImage(unsigned.EmitToArray)})).VerifyDiagnostics()
1723other.WithReferences({other.References(0), MetadataReference.CreateFromImage(unsigned.EmitToArray)})}
2568Dim imageReference As MetadataReference = other.EmitToImageReference()
2685Dim imageReference As MetadataReference = other.EmitToImageReference()
Emit\CompilationEmitTests.vb (14)
291Dim usingComp = CreateCompilationWithMscorlib40(srcUsing, references:={MetadataReference.CreateFromImage(mdOnlyImage.AsImmutableOrNull())})
876Private Sub RefAssemblyNoPia_VerifyRefOnly(source As Xml.Linq.XElement, reference As MetadataReference)
882Private Sub RefAssemblyNoPia_VerifyRefOut(source As Xml.Linq.XElement, reference As MetadataReference)
948Private Sub RefAssemblyNoPiaReferenceFromMethodBody_VerifyRefOnly(source As Xml.Linq.XElement, reference As MetadataReference)
954Private Sub RefAssemblyNoPiaReferenceFromMethodBody_VerifyRefOut(source As Xml.Linq.XElement, reference As MetadataReference)
2037c = VisualBasicCompilation.Create("Nothing", references:={MetadataReference.CreateFromImage(s.ToImmutable())})
3860Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseDll.WithPlatform(Platform.Itanium))
3952Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseModule.WithPlatform(Platform.Itanium))
4003Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseDll.WithPlatform(Platform.X86))
4065Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseModule.WithPlatform(Platform.X86))
4099Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseDll.WithPlatform(Platform.AnyCpu))
4157Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseModule.WithPlatform(Platform.AnyCpu))
4190Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseDll.WithPlatform(Platform.Itanium))
4248Dim refCompilation = CreateEmptyCompilationWithReferences(refSource, New MetadataReference() {}, TestOptions.ReleaseModule.WithPlatform(Platform.Itanium))
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Scripting (2)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (107)
Compilation\CompilationAPITests.vb (14)
281Dim listRef = New List(Of MetadataReference)
539comp = comp.AddReferences(Enumerable.Empty(Of MetadataReference)())
562Dim hs1 As New HashSet(Of MetadataReference) From {ref1, ref2, ref3}
564AssertEx.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(compCollection1.References))
566AssertEx.Equal(Of Integer)(3, Enumerable.Count(Of MetadataReference)(c2.References))
570AssertEx.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(compCollection2.References))
572AssertEx.Equal(Of Integer)(3, Enumerable.Count(Of MetadataReference)(c3.References))
587AssertEx.Equal(Of Integer)(0, Enumerable.Count(Of MetadataReference)(c2.References))
590Dim hs = New HashSet(Of MetadataReference)() From {ref1, ref2, ref3}
598Dim col = New ObjectModel.Collection(Of MetadataReference)() From {ref1, ref2, ref3}
606Dim stack = New Concurrent.ConcurrentStack(Of MetadataReference)
617Dim queue = New Concurrent.ConcurrentQueue(Of MetadataReference)
841Dim listRef = New List(Of MetadataReference)
1206Dim listRef = New List(Of MetadataReference) From {ref1, ref2, ref3, ref4}
Compilation\ReferenceManagerTests.vb (32)
24Dim v1 = MetadataReference.CreateFromImage(TestResources.General.C1.AsImmutableOrNull())
27Dim v2 = MetadataReference.CreateFromImage(TestResources.General.C2.AsImmutableOrNull())
51Dim testRefV1 = CreateCompilationWithMscorlib40({testRefSource.Value}, New MetadataReference() {New VisualBasicCompilationReference(refV1), v2}, options:=TestOptions.ReleaseDll)
54Dim testRefV2 = CreateCompilationWithMscorlib40({testRefSource.Value}, New MetadataReference() {New VisualBasicCompilationReference(refV2), v1}, options:=TestOptions.ReleaseDll)
73Dim v1 = MetadataReference.CreateFromImage(TestResources.General.C1.AsImmutableOrNull())
74Dim v2 = MetadataReference.CreateFromImage(TestResources.General.C2.AsImmutableOrNull())
92Dim testRefV1 = CreateCompilationWithMscorlib40({refSource.Value}, New MetadataReference() {New VisualBasicCompilationReference(refV1), v2}, options:=TestOptions.ReleaseDll)
95Dim testRefV2 = CreateCompilationWithMscorlib40({refSource.Value}, New MetadataReference() {New VisualBasicCompilationReference(refV2), v1}, options:=TestOptions.ReleaseDll)
637Dim main = CreateCompilationWithMscorlib40AndVBRuntimeAndReferences(sourceMain, {MetadataReference.CreateFromImage(refLibV1.EmitToArray()), New VisualBasicCompilationReference(libV2)})
777Dim metadataLibV1 = MetadataReference.CreateFromImage(imageLibV1)
798MetadataReference.CreateFromFile(tempFile1_copy1.Path),
799MetadataReference.CreateFromFile(tempFile2.Path),
800MetadataReference.CreateFromFile(tempFile1_copy2.Path)}, TestOptions.ReleaseDll)
808MetadataReference.CreateFromFile(tempFile1_copy1.Path),
809MetadataReference.CreateFromFile(tempFile2.Path),
810MetadataReference.CreateFromFile(tempFile1_copy1.Path)}, TestOptions.ReleaseDll)
1141Dim refB = MetadataReference.CreateFromImage(b.EmitToArray())
1145Dim refA2 = MetadataReference.CreateFromImage(a2.EmitToArray())
1681Dim resolver As TestMissingMetadataReferenceResolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1709Dim resolver As TestMissingMetadataReferenceResolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1744Dim resolver As TestMissingMetadataReferenceResolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1774Dim resolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference)())
1789Dim resolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference)())
1812Dim resolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1840Dim resolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1872Dim resolver = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1903Dim resolverA = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1914Dim resolverC = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1944Dim resolverA = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1956Dim resolverC = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
1990Dim resolverC = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
2038Dim resolverC = New TestMissingMetadataReferenceResolver(New Dictionary(Of String, MetadataReference) From
Semantics\OptionalArgumentTests.vb (17)
692Dim compilationRef As MetadataReference = libComp.ToMetadataReference()
701Dim metadataRef = MetadataReference.CreateFromImage(libComp.EmitToArray())
762Dim libRef = MetadataReference.CreateFromImage(libComp.EmitToArray())
764CompileAndVerify(source, references:=New MetadataReference() {libRef}, expectedOutput:=<![CDATA[
852Dim metadataRef = MetadataReference.CreateFromImage(libComp.EmitToArray())
935Dim libRef As MetadataReference = libComp.ToMetadataReference()
937Dim comp = CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntimeAndReferences(source, references:=New MetadataReference() {libRef})
943libRef = MetadataReference.CreateFromImage(libComp.EmitToArray())
945CompileAndVerify(source, references:=New MetadataReference() {libRef}, expectedOutput:=<![CDATA[
1007Dim libRef As MetadataReference = libComp.ToMetadataReference()
1009CompileAndVerify(source, references:=New MetadataReference() {libRef}, expectedOutput:=<![CDATA[
1016libRef = MetadataReference.CreateFromImage(libComp.EmitToArray())
1018CompileAndVerify(source, references:=New MetadataReference() {libRef}, expectedOutput:=<![CDATA[
1026references:=New MetadataReference() {libRef},
1687compilation = CreateEmptyCompilationWithReferences(source, {MscorlibRef_v4_0_30316_17626, MsvbRef, MetadataReference.CreateFromImage(attributeCompilation.EmitToArray())}, TestOptions.ReleaseExe)
1945referencedAssemblies:=New MetadataReference() {MscorlibRef_v4_0_30316_17626})
1947Dim reference1 = MetadataReference.CreateFromImage(compilation1.EmitToArray())
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (208)
SymbolsTests\Retargeting\NoPia.vb (37)
571Private Sub CyclicReference(piaRef As MetadataReference, localTypes1Ref As CompilationReference)
1085Dim piaImage = MetadataReference.CreateFromImage(pia.EmitToArray())
1111Dim localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray())
1114references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), New VisualBasicCompilationReference(pia)})
1125references:=New MetadataReference() {localTypes2Image, New VisualBasicCompilationReference(pia)})
1136references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), piaImage})
1147references:=New MetadataReference() {localTypes2Image, piaImage})
1177Dim piaImage = MetadataReference.CreateFromImage(pia.EmitToArray())
1202Dim localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray())
1205references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), New VisualBasicCompilationReference(pia)})
1216references:=New MetadataReference() {localTypes2Image, New VisualBasicCompilationReference(pia)})
1227references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), piaImage})
1238references:=New MetadataReference() {localTypes2Image, piaImage})
1268Dim piaImage = MetadataReference.CreateFromImage(pia.EmitToArray())
1293Dim localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray())
1296references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), New VisualBasicCompilationReference(pia)})
1307references:=New MetadataReference() {localTypes2Image, New VisualBasicCompilationReference(pia)})
1318references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), piaImage})
1329references:=New MetadataReference() {localTypes2Image, piaImage})
1359Dim piaImage = MetadataReference.CreateFromImage(pia.EmitToArray())
1374references:=New MetadataReference() {New VisualBasicCompilationReference(pia, embedInteropTypes:=True)})
1378references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), New VisualBasicCompilationReference(pia)})
1389references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), piaImage})
1419Dim piaImage = MetadataReference.CreateFromImage(pia.EmitToArray())
1445Dim localTypes2Image = MetadataReference.CreateFromImage(localTypes2.EmitToArray())
1448references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), New VisualBasicCompilationReference(pia)})
1459references:=New MetadataReference() {localTypes2Image, New VisualBasicCompilationReference(pia)})
1470references:=New MetadataReference() {New VisualBasicCompilationReference(localTypes2), piaImage})
1481references:=New MetadataReference() {localTypes2Image, piaImage})
1512referencedAssemblies:=New MetadataReference() {MscorlibRef})
1525referencedAssemblies:=New MetadataReference() {MscorlibRef})
1541referencedAssemblies:=New MetadataReference() {MscorlibRef, pia1Image})
1543Dim compilation1Image = MetadataReference.CreateFromImage(compilation1.EmitToArray())
1546references:=New MetadataReference() {compilation1Image, pia1Image})
1561references:=New MetadataReference() {compilation1Image, pia2Image})
1722For Each piaRef As MetadataReference In {piaCompilation.EmitToImageReference(), piaCompilation.ToMetadataReference()}
1725For Each consumer1Ref As MetadataReference In {compilation1.EmitToImageReference(), compilation1.ToMetadataReference()}
UsedAssembliesTests.vb (54)
70Private Sub VerifyUsedAssemblyReferences(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference As MetadataReference)
75Private Sub VerifyUsedAssemblyReferences(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference0 As MetadataReference, reference1 As MetadataReference)
80Private Sub AssertUsedAssemblyReferences(comp As Compilation, expected As MetadataReference(), before As XElement, after As XElement, specificReferencesToAssert As MetadataReference())
110Private Sub AssertUsedAssemblyReferences(comp As Compilation, ParamArray expected As MetadataReference())
114Private Sub AssertUsedAssemblyReferences(comp As Compilation, expected As MetadataReference(), specificReferencesToAssert As MetadataReference())
118Private Function AssertUsedAssemblyReferences(source As BasicTestSource, references As MetadataReference(), ParamArray expected As MetadataReference()) As Compilation
124Private Function AssertUsedAssemblyReferences(source As BasicTestSource, ParamArray references As MetadataReference()) As Compilation
128Private Shared Sub AssertUsedAssemblyReferences(source As BasicTestSource, references As MetadataReference(), expected As XElement)
137Private Function CompileWithUsedAssemblyReferences(source As BasicTestSource, targetFramework As TargetFramework, ParamArray references As MetadataReference()) As ImmutableArray(Of MetadataReference)
141Private Function CompileWithUsedAssemblyReferences(source As BasicTestSource, targetFramework As TargetFramework, options As VisualBasicCompilationOptions, ParamArray references As MetadataReference()) As ImmutableArray(Of MetadataReference)
149Private Function CompileWithUsedAssemblyReferences(comp As Compilation, Optional expectedOutput As String = Nothing, Optional specificReferencesToAssert As MetadataReference() = Nothing) As ImmutableArray(Of MetadataReference)
173Private Function CompileWithUsedAssemblyReferences(source As BasicTestSource, ParamArray references As MetadataReference()) As ImmutableArray(Of MetadataReference)
177Private Function CompileWithUsedAssemblyReferences(source As BasicTestSource, options As VisualBasicCompilationOptions, ParamArray references As MetadataReference()) As ImmutableArray(Of MetadataReference)
221Private Sub Verify_NoReferences_03(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference As MetadataReference)
255Private Sub Verify_NoReferences_04(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference As MetadataReference)
378Private Sub Verify_FieldReference_02(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference0 As MetadataReference, reference1 As MetadataReference)
479Private Function Verify2_FieldReference_03(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference0 As MetadataReference, reference1 As MetadataReference) As Compilation
485Private Sub Verify3_FieldReference_03(Of TAssemblySymbol As AssemblySymbol)(source3 As BasicTestSource, ParamArray references As MetadataReference())
555Private Sub VerifyUsedAssemblyReferences(reference As MetadataReference, source As BasicTestSource)
757Private Sub VerifyUsedAssemblyReferences(reference0 As MetadataReference, reference1 As MetadataReference, source As BasicTestSource)
921reference0 As MetadataReference,
922reference1 As MetadataReference,
2034reference As MetadataReference,
3054Sub(source2 As String, ref0 As MetadataReference, ref1 As MetadataReference)
3474Sub(reference0 As MetadataReference, reference1 As MetadataReference, source As String, hasTypeReferencesInImports As Boolean)
3720Sub(reference0 As MetadataReference,
3721reference1 As MetadataReference,
3722reference2 As MetadataReference,
3796Sub(reference0 As MetadataReference,
3797reference1 As MetadataReference,
3798reference2 As MetadataReference,
3902Sub(reference0 As MetadataReference, reference1 As MetadataReference, reference2 As MetadataReference, source As String, namespaceOrdinalReferencedInImports As Integer)
3906Dim compExpected As MetadataReference()
4085Sub(reference0 As MetadataReference, reference1 As MetadataReference, reference2 As MetadataReference, source As String, namespaceOrdinalReferencedInImports As Integer)
4089Dim expected1 As MetadataReference()
4738Dim getReference As Func(Of Compilation, MetadataReference) = Function(c) If(useImageReferences, c.EmitToImageReference(), c.ToMetadataReference())
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (51)
BasicTestBase.vb (14)
33Optional references As MetadataReference() = Nothing,
130Optional references As MetadataReference() = Nothing,
166allReferences As IEnumerable(Of MetadataReference),
208allReferences As IEnumerable(Of MetadataReference),
245Optional allReferences() As MetadataReference = Nothing,
275Optional references() As MetadataReference = Nothing,
303Optional references As IEnumerable(Of MetadataReference) = Nothing,
378Dim reference As MetadataReference = Nothing
380reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
426Optional references As IEnumerable(Of MetadataReference) = Nothing,
879Optional references As IEnumerable(Of MetadataReference) = Nothing,
885Dim allReferences As IEnumerable(Of MetadataReference) = TargetFrameworkUtil.Mscorlib45ExtendedReferences.Add(
900Optional additionalReferences As IEnumerable(Of MetadataReference) = Nothing,
905Dim references As IEnumerable(Of MetadataReference) = TargetFrameworkUtil.Mscorlib45ExtendedReferences.Add(
CompilationTestUtils.vb (28)
27Optional references As IEnumerable(Of MetadataReference) = Nothing,
39Optional references As IEnumerable(Of MetadataReference) = Nothing,
51Optional references As IEnumerable(Of MetadataReference) = Nothing,
114Private Sub AssertSubset(used As ImmutableArray(Of MetadataReference), resolvedReferences As IEnumerable(Of MetadataReference))
123Optional references As MetadataReference() = Nothing,
140Optional references As IEnumerable(Of MetadataReference) = Nothing,
149Optional references As IEnumerable(Of MetadataReference) = Nothing,
158Optional references As IEnumerable(Of MetadataReference) = Nothing,
170references As IEnumerable(Of MetadataReference),
173Return CreateEmptyCompilationWithReferences(source, {CType(Net40.References.mscorlib, MetadataReference)}.Concat(references), options, parseOptions:=parseOptions)
204Optional additionalRefs As MetadataReference() = Nothing,
210Dim references = {CType(Net40.References.mscorlib, MetadataReference), Net40.References.System, Net40.References.MicrosoftVisualBasic}.Concat(additionalRefs)
228Public ReadOnly XmlReferences As MetadataReference() = {SystemRef, SystemCoreRef, SystemXmlRef, SystemXmlLinqRef}
230Public ReadOnly Net40XmlReferences As MetadataReference() = {Net40.References.SystemCore, Net40.References.SystemXml, Net40.References.SystemXmlLinq}
232Public ReadOnly Net461XmlReferences As MetadataReference() = {Net461.References.SystemCore, Net461.References.SystemXml, Net461.References.SystemXmlLinq}
246Optional references As IEnumerable(Of MetadataReference) = Nothing,
251Dim allReferences = {CType(Net40.References.mscorlib, MetadataReference), Net40.References.System, Net40.References.MicrosoftVisualBasic}.Concat(references)
271Optional references As IEnumerable(Of MetadataReference) = Nothing,
290references As IEnumerable(Of MetadataReference),
318references As IEnumerable(Of MetadataReference),
325references As IEnumerable(Of MetadataReference),
381Optional additionalReferences As IEnumerable(Of MetadataReference) = Nothing,
382<Out> Optional ByRef ilReference As MetadataReference = Nothing,
385Dim references = If(additionalReferences IsNot Nothing, New List(Of MetadataReference)(additionalReferences), New List(Of MetadataReference))
403Public Function CreateReferenceFromIlCode(ilSource As String, Optional appendDefaultHeader As Boolean = True, <Out> Optional ByRef ilImage As ImmutableArray(Of Byte) = Nothing) As MetadataReference
407Return MetadataReference.CreateFromImage(ilImage)
MockVisualBasicCompiler.vb (3)
17Private ReadOnly _additionalReferences As ImmutableArray(Of MetadataReference)
35Public Sub New(responseFile As String, workingDirectory As String, args As String(), Optional analyzers As DiagnosticAnalyzer() = Nothing, Optional generators As ISourceGenerator() = Nothing, Optional additionalReferences As MetadataReference() = Nothing)
39Public Sub New(responseFile As String, buildPaths As BuildPaths, args As String(), Optional analyzers As DiagnosticAnalyzer() = Nothing, Optional generators As ISourceGenerator() = Nothing, Optional additionalReferences As MetadataReference() = Nothing)
Microsoft.CodeAnalysis.Workspaces (76)
Microsoft.CodeAnalysis.Workspaces.MSBuild (15)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (13)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (27)
Microsoft.CodeAnalysis.Workspaces.UnitTests (28)
FindReferencesTests.cs (2)
27private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, IEnumerable<MetadataReference> metadataReference, params ProjectId[] projectReferences)
43private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, MetadataReference metadataReference, params ProjectId[] projectReferences)
Microsoft.Gen.ComplianceReports.Unit.Tests (5)
Microsoft.Gen.ContextualOptions.Unit.Tests (5)
Microsoft.Gen.Logging.Unit.Tests (20)
Microsoft.Gen.Metrics.Unit.Tests (5)
Microsoft.Gen.MetricsReports.Unit.Tests (5)
Microsoft.ML.CodeAnalyzer.Tests (5)
Microsoft.VisualStudio.LanguageServices (15)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Mvc.Analyzers.Test (8)
Mvc.Api.Analyzers.Test (1)
Roslyn.VisualStudio.Next.UnitTests (4)
SemanticSearch.BuildTask (1)
SemanticSearch.BuildTask.UnitTests (3)
StackDepthTest (2)
System.Windows.Forms.Design.Tests (5)
System.Windows.Forms.PrivateSourceGenerators.Tests (2)
WinShimmer (3)