2 types derived from CompilationReference
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpCompilationReference.cs (1)
16internal sealed class CSharpCompilationReference : CompilationReference
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\VisualBasicCompilationReference.vb (1)
18Inherits CompilationReference
385 references to CompilationReference
Microsoft.CodeAnalysis (21)
Compilation\Compilation.cs (3)
661where T : CompilationReference 675Debug.Assert(reference is UnresolvedMetadataReference || reference is CompilationReference); 741public abstract CompilationReference ToMetadataReference(ImmutableArray<string> aliases = default(ImmutableArray<string>), bool embedInteropTypes = false);
Compilation\DeterministicKeyBuilder.cs (1)
322else if (reference is CompilationReference compilationReference)
MetadataReference\CompilationReference.cs (8)
16public abstract class CompilationReference : MetadataReference, IEquatable<CompilationReference> 52public new CompilationReference WithAliases(IEnumerable<string> aliases) 62public new CompilationReference WithAliases(ImmutableArray<string> aliases) 72public new CompilationReference WithEmbedInteropTypes(bool value) 82public new CompilationReference WithProperties(MetadataReferenceProperties properties) 107internal abstract CompilationReference WithPropertiesImpl(MetadataReferenceProperties properties); 117public bool Equals(CompilationReference? other) 135return Equals(obj as CompilationReference);
ReferenceManager\CommonReferenceManager.Resolution.cs (9)
42CompilationReference compilationReference); 282var compilationReference = boundReference as CompilationReference; 581var cx = x as CompilationReference; 584var cy = y as CompilationReference; 596var compilationReference = reference as CompilationReference;
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (2)
27foreach (var reference in compilation.References.OfType<CompilationReference>())
Microsoft.CodeAnalysis.CSharp (3)
Compilation\CSharpCompilation.cs (1)
1284public override CompilationReference ToMetadataReference(ImmutableArray<string> aliases = default, bool embedInteropTypes = false)
Compilation\CSharpCompilationReference.cs (1)
49internal override CompilationReference WithPropertiesImpl(MetadataReferenceProperties properties)
Symbols\ReferenceManager.cs (1)
85protected override AssemblyData CreateAssemblyDataForCompilation(CompilationReference compilationReference)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenTupleTest.cs (3)
1690var compLibCompilationRef = compLib.ToMetadataReference(); 13915var comp2CompilationRef = comp2.ToMetadataReference(); 14080var comp2CompilationRef = comp2.ToMetadataReference();
Emit\CompilationEmitTests.cs (2)
1037var piaMetadataReference = pia.ToMetadataReference(embedInteropTypes: true); 1116var piaMetadataReference = pia.ToMetadataReference(embedInteropTypes: true);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Emit\EditAndContinue\AssemblyReferencesTests.cs (4)
471var ref01 = lib01.ToMetadataReference(ImmutableArray.Create("L0")); 474var ref02 = lib02.ToMetadataReference(ImmutableArray.Create("L0")); 477var ref11 = lib11.ToMetadataReference(ImmutableArray.Create("L1")); 480var ref12 = lib12.ToMetadataReference(ImmutableArray.Create("L1"));
Emit\NumericIntPtrTests.cs (4)
938var ref1 = comp.ToMetadataReference(); 1000var ref1 = comp.ToMetadataReference(); 1193var ref1 = comp.ToMetadataReference(); 3056var ref1 = comp.ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (64)
Attributes\AttributeTests.cs (2)
8451var comp1 = CreateCompilationWithMscorlib40(source2, assemblyName: "Temp0").ToMetadataReference(); 8477var comp2 = CreateEmptyCompilation(source3, assemblyName: "Temp2").ToMetadataReference();
Attributes\AttributeTests_Assembly.cs (1)
1520var defsRef = CreateCompilationWithMscorlib40(defaultHeaderString + s_defaultNetModuleSourceBody).ToMetadataReference();
Attributes\AttributeTests_Dynamic.cs (1)
967var customRef = CreateCompilationWithMscorlib46(customDynamicAttrSource).ToMetadataReference();
Attributes\AttributeTests_Embedded.cs (2)
246var reference = CreateCompilation(@" 270var reference = CreateCompilation(assemblyName: "testRef", parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), source: @"
Attributes\AttributeTests_IsByRefLike.cs (8)
137var referenceA = CreateCompilation(new[] { codeA, GetCompilerFeatureRequiredAttributeText(includeCompilerFeatureRequired) }).VerifyDiagnostics().ToMetadataReference(); 164var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 191var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 217var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 246var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 275var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 312var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 428var reference = CreateCompilation(@"
Attributes\AttributeTests_ReadOnlyStruct.cs (8)
127var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 154var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 181var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 207var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 236var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 265var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 302var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 418var reference = CreateCompilation(@"
Attributes\AttributeTests_RefReadOnly.cs (19)
108var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 191var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 264var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 356var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 462var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 552var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 668var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 799var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 841var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 868var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 894var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 923var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 952var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 989var referenceA = CreateCompilation(codeA).VerifyDiagnostics().ToMetadataReference(); 1144var reference = CreateCompilation(@" 1742var reference = CreateCompilation(@" 1833var reference = CreateCompilation(@" 1991var reference = CreateCompilation(@" 2080var reference = CreateCompilation(@"
Attributes\AttributeTests_WellKnownAttributes.cs (1)
11581var reference = comp1.Compilation.ToMetadataReference();
Attributes\InternalsVisibleToAndStrongNameTests.cs (2)
3052CompilationReference compilationReference = lib.ToMetadataReference(); 3176CompilationReference compilationReference = lib.ToMetadataReference();
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1884var metadataReference = CreateCompilation(source).ToMetadataReference();
FirstClassSpanTests.cs (1)
2683var comp1Ref = CreateCompilation(source1, targetFramework: TargetFramework.Mscorlib40)
RefReadonlyParameterTests.cs (11)
1560var comp1Ref = comp1.ToMetadataReference(); 3167var comp1Ref = comp1.ToMetadataReference(); 7154var comp1Ref = comp1.ToMetadataReference(embedInteropTypes: true); 7706var comp1Ref = comp1.ToMetadataReference(); 7808var comp1Ref = comp1.ToMetadataReference(); 7973var comp1Ref = comp1.ToMetadataReference(); 8048var comp1Ref = comp1.ToMetadataReference(); 8214var comp1Ref = comp1.ToMetadataReference(); 8329var comp1Ref = comp1.ToMetadataReference(); 8541var comp1Ref = comp1.ToMetadataReference(); 8635var comp1Ref = comp1.ToMetadataReference();
RefStructInterfacesTests.cs (2)
20047var comp1Ref = CreateCompilation(src1, targetFramework: s_targetFrameworkSupportingByRefLikeGenerics).ToMetadataReference(); 20304var comp1Ref = CreateCompilation(src1, targetFramework: s_targetFrameworkSupportingByRefLikeGenerics).ToMetadataReference();
Semantics\CollectionExpressionTests.cs (2)
7693var refA = comp.ToMetadataReference(); 19486var refA = comp.ToMetadataReference();
Semantics\ParamsCollectionTests.cs (2)
12765var comp1Ref = comp1.ToMetadataReference(); 12789var comp5Ref = comp5.ToMetadataReference();
Semantics\RecordTests.cs (1)
13303var refA = compA.ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IArgument.cs (1)
1257var lib0 = CreateCompilation(source0).ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
532var portableLibRef = portableLib.ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (40)
Semantics\GlobalUsingDirectiveTests.cs (13)
167var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "alias1" }); 276var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "alias1" }); 386var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "alias1" }); 435var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 581var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 1140var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 1275var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 2045var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "alias1", "alias2" }); 2195var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "alias1" }); 3367CompilationReference newCompRef = newComp.ToMetadataReference(); 3454var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 3645var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 4514var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "A" });
Semantics\NativeIntegerTests.cs (20)
185var ref1 = comp.ToMetadataReference(); 701var ref1 = comp.ToMetadataReference(); 777var refA = comp.ToMetadataReference(); 858var refA = comp.ToMetadataReference(); 973var refA = comp.ToMetadataReference(); 1065var refB = comp.ToMetadataReference(); 1227var refA = comp.ToMetadataReference(); 1512var ref1 = comp.ToMetadataReference(); 1594var ref1 = comp.ToMetadataReference(); 1647var ref1 = comp.ToMetadataReference(); 3117var ref1 = comp.ToMetadataReference(); 3161var ref1 = comp.ToMetadataReference(); 3196var ref1 = comp.ToMetadataReference(); 3258var ref1 = comp.ToMetadataReference(); 3301var ref1 = comp.ToMetadataReference(); 3360var ref1 = comp.ToMetadataReference(); 3532var ref1 = comp.ToMetadataReference(); 3565var ref1 = comp.ToMetadataReference(); 3598var ref1 = comp.ToMetadataReference(); 7218var ref1 = comp.ToMetadataReference();
Semantics\OverloadResolutionTests.cs (1)
9576var comp1Ref = comp1.ToMetadataReference();
Semantics\RefFieldTests.cs (3)
330var refA = comp.ToMetadataReference(); 11965var refA = comp.ToMetadataReference(); 22870var refA = comp.ToMetadataReference();
Semantics\ScriptSemanticsTests.cs (1)
24private static CompilationReference TaskFacadeAssembly(bool includeNamespaceAroundTaskExtension = true)
Semantics\StructConstructorTests.cs (2)
223var refA = comp.ToMetadataReference(); 3219var refA = comp.ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (196)
Compilation\CompilationAPITests.cs (4)
1180var compRef1 = comp1.ToMetadataReference(); 1181var compRef2 = comp2.ToMetadataReference(); 1183var compRef = vbComp.ToMetadataReference(embedInteropTypes: true); 1381var compRef = vbComp.ToMetadataReference();
Compilation\ReferenceManagerTests.cs (8)
981var ref1 = lib1.ToMetadataReference(embedInteropTypes: true); 982var ref2 = lib2.ToMetadataReference(embedInteropTypes: false); 2704var aRef = CreateCompilationWithMscorlib46("public interface A : D { }", new[] { dRef }, assemblyName: "A").ToMetadataReference(); 2720var aRef = CreateCompilationWithMscorlib46("public interface A : D { }", new[] { dRef }, assemblyName: "A").ToMetadataReference(); 2743var aRef = CreateCompilationWithMscorlib46("public interface A : D { }", new[] { bRef }, assemblyName: "A").ToMetadataReference(); 2745var eRef = CreateCompilationWithMscorlib46("public interface E { }", assemblyName: "E").ToMetadataReference(); 2769var aRef = CreateCompilationWithMscorlib46("public interface A : D { }", new[] { dRef }, assemblyName: "A").ToMetadataReference(); 2770var bRef = CreateCompilationWithMscorlib46("public interface B : D { }", new[] { dRef }, assemblyName: "B").ToMetadataReference();
Compilation\UsedAssembliesTests.cs (123)
455var comp1Ref = comp1.ToMetadataReference(); 507var comp0Ref = comp0.ToMetadataReference(); 521var comp1Ref = comp1.ToMetadataReference(); 577var comp0Ref = comp0.ToMetadataReference(); 604var comp2Ref = comp2.ToMetadataReference(); 685var comp1Ref = comp1.ToMetadataReference(); 747var comp0Ref = comp0.ToMetadataReference(); 766var comp1Ref = comp1.ToMetadataReference(); 947var comp0Ref = comp0.ToMetadataReference(); 966var comp1Ref = comp1.ToMetadataReference(); 1118var comp0Ref = comp0.ToMetadataReference(); 1132var comp1Ref = comp1.ToMetadataReference(); 1278var comp0Ref = comp0.ToMetadataReference(); 1292var comp1Ref = comp1.ToMetadataReference(); 1416var reference0 = comp0.ToMetadataReference(); 1417var reference1 = comp1.ToMetadataReference(); 1469var comp0Ref = comp0.ToMetadataReference(); 1479var comp1Ref = comp1.ToMetadataReference(); 1507var comp0Ref = comp0.ToMetadataReference(); 1517var comp1Ref = comp1.ToMetadataReference(); 1548var comp0Ref = comp0.ToMetadataReference(); 1560var comp1Ref = comp1.ToMetadataReference(); 1570var comp2Ref = comp2.ToMetadataReference(); 1628var comp5Ref = comp5.ToMetadataReference(embedInteropTypes: true); 1631var comp6Ref = comp6.ToMetadataReference(); 1635var comp7Ref = comp7.ToMetadataReference(embedInteropTypes: false); 1684var comp0Ref = comp0.ToMetadataReference(); 1694var comp1Ref = comp1.ToMetadataReference(); 1705var comp2Ref = comp2.ToMetadataReference(); 1737var comp0Ref = comp0.ToMetadataReference(); 1747var comp1Ref = comp1.ToMetadataReference(); 1757var comp2Ref = comp2.ToMetadataReference(); 1791var comp0Ref = comp0.ToMetadataReference(); 1803var comp1Ref = comp1.ToMetadataReference(); 1874var comp0Ref = comp0.ToMetadataReference(); 1886var comp1Ref = comp1.ToMetadataReference(); 1941var comp5Ref = comp5.ToMetadataReference(embedInteropTypes: true); 1944var comp6Ref = comp6.ToMetadataReference(); 1948var comp7Ref = comp7.ToMetadataReference(embedInteropTypes: false); 1969var comp1Ref = comp1.ToMetadataReference(); 2023var comp0Ref = comp0.ToMetadataReference(); 2033var comp1Ref = comp1.ToMetadataReference(); 2063var comp0Ref = comp0.ToMetadataReference(); 2074var comp1Ref = comp1.ToMetadataReference(); 2107var comp1Ref = comp1.ToMetadataReference(); 2167var comp1Ref = comp1.ToMetadataReference(); 2361var comp1Ref = comp1.ToMetadataReference(); 2428var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2441var comp1Ref = comp1.ToMetadataReference(); 2461var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2496var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2508var comp1Ref = comp1.ToMetadataReference(); 2512var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2584var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2596var comp1Ref = comp1.ToMetadataReference(); 2600var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2672var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2684var comp1Ref = comp1.ToMetadataReference(); 2688var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2756var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2769var comp1Ref = comp1.ToMetadataReference(); 2773var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2845var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2857var comp1Ref = comp1.ToMetadataReference(); 2861var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2933var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2945var comp1Ref = comp1.ToMetadataReference(); 2949var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2997var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 3036var comp1Ref = comp1.ToMetadataReference(); 3040var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 3306var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 3346var comp1Ref = comp1.ToMetadataReference(); 3350var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 3557var comp0Ref = comp0.ToMetadataReference(); 3574var comp1Ref = comp1.ToMetadataReference(); 3705var comp0Ref = comp0.ToMetadataReference(); 3722var comp1Ref = comp1.ToMetadataReference(); 3853var comp0Ref = comp0.ToMetadataReference(); 3866var comp1Ref = comp1.ToMetadataReference(); 3929var comp0Ref = comp0.ToMetadataReference(); 3942var comp1Ref = comp1.ToMetadataReference(); 4044var comp0Ref = comp0.ToMetadataReference(); 4057var comp1Ref = comp1.ToMetadataReference(); 4148var comp0Ref = comp0.ToMetadataReference(); 4157var comp1Ref = comp1.ToMetadataReference(); 4263var comp0Ref = comp0.ToMetadataReference(); 4276var comp1Ref = comp1.ToMetadataReference(); 4289var comp2Ref = comp2.ToMetadataReference(); 4346var comp0Ref = comp0.ToMetadataReference(); 4359var comp1Ref = comp1.ToMetadataReference(); 4372var comp2Ref = comp2.ToMetadataReference(); 4464var comp0Ref = comp0.ToMetadataReference(); 4477var comp1Ref = comp1.ToMetadataReference(); 4490var comp2Ref = comp2.ToMetadataReference(); 4652var comp0Ref = comp0.ToMetadataReference(); 4665var comp1Ref = comp1.ToMetadataReference(); 4678var comp2Ref = comp2.ToMetadataReference(); 4905var comp0Ref = comp0.ToMetadataReference(); 4922var comp1Ref = comp1.ToMetadataReference(); 4995var comp0Ref = comp0.ToMetadataReference(); 5012var comp1Ref = comp1.ToMetadataReference(); 5055var comp0Ref = comp0.ToMetadataReference(); 5067var comp1Ref = comp1.ToMetadataReference(); 5142var comp0Ref = comp0.ToMetadataReference(); 5154var comp1Ref = comp1.ToMetadataReference(); 5400var comp0Ref = comp0.ToMetadataReference(); 5412var comp1Ref = comp1.ToMetadataReference(); 5461var comp0Ref = comp0.ToMetadataReference(); 5476var comp1Ref = comp1.ToMetadataReference(); 5487var comp2Ref = comp2.ToMetadataReference(); 5634var comp1Ref = comp1.ToMetadataReference(); 5678var comp0Ref = comp0.ToMetadataReference(); 5688var comp1Ref = comp1.ToMetadataReference(); 5716var comp0Ref = comp0.ToMetadataReference(); 5726var comp1Ref = comp1.ToMetadataReference(); 5755var comp0Ref = comp0.ToMetadataReference(); 5756var comp0RefWithAlias = comp0Ref.WithAliases(new[] { "Alias0" }); 5766var comp1Ref = comp1.ToMetadataReference(); 5767var comp1RefWithAlias = comp1Ref.WithAliases(new[] { "Alias0" }); 5916var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "N1C1" }); 5928var comp2Ref = comp2.ToMetadataReference(); 6007var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "N1C1" });
Symbols\CovariantReturnTests.cs (13)
460CompilationReference compAsMetadata = comp.ToMetadataReference(); 499CompilationReference compAsMetadata = comp.ToMetadataReference(); 3873var baseMetadata = baseCompilation.ToMetadataReference(); 3949var baseMetadata = baseCompilation.ToMetadataReference(); 4115var baseMetadata = baseCompilation.ToMetadataReference(); 4230var baseMetadata = baseCompilation.ToMetadataReference(); 4339var baseMetadata = baseCompilation.ToMetadataReference(); 4506var baseMetadata = baseCompilation.ToMetadataReference(); 4730var baseMetadata = baseCompilation.ToMetadataReference(); 4793var baseMetadata = baseCompilation.ToMetadataReference(); 4857var baseMetadata = baseCompilation.ToMetadataReference(); 4914var baseMetadata = baseCompilation.ToMetadataReference(); 4978var baseMetadata = baseCompilation.ToMetadataReference();
Symbols\DefaultInterfaceImplementationTests.cs (33)
38885compilation3.VerifyDiagnostics(ref1 is CompilationReference ? expected1 : expected2 ?? expected1); 46595CompilationReference compilationReference = compilation1.ToMetadataReference(); 47022CompilationReference compilationReference = compilation1.ToMetadataReference(); 47228CompilationReference compilationReference = compilation1.ToMetadataReference(); 47320CompilationReference compilationReference = compilation1.ToMetadataReference(); 47396CompilationReference compilationReference = compilation1.ToMetadataReference(); 47468CompilationReference compilationReference = compilation1.ToMetadataReference(); 47526CompilationReference compilationReference = compilation1.ToMetadataReference(); 47607CompilationReference compilationReference = compilation1.ToMetadataReference(); 47681CompilationReference compilationReference0 = compilation0.ToMetadataReference(); 47713CompilationReference compilationReference3 = compilation3.ToMetadataReference(); 47742CompilationReference compilationReference6 = compilation6.ToMetadataReference(); 47814CompilationReference compilationReference0 = compilation0.ToMetadataReference(); 47846CompilationReference compilationReference3 = compilation3.ToMetadataReference(); 47875CompilationReference compilationReference6 = compilation6.ToMetadataReference(); 47942CompilationReference compilationReference = compilation1.ToMetadataReference(); 48009CompilationReference compilationReference = compilation1.ToMetadataReference(); 48085CompilationReference compilationReference = compilation1.ToMetadataReference(); 48142CompilationReference compilationReference = compilation1.ToMetadataReference(); 48209CompilationReference compilationReference = compilation1.ToMetadataReference(); 48306CompilationReference compilationReference = compilation1.ToMetadataReference(); 48376CompilationReference compilationReference = compilation1.ToMetadataReference(); 48440CompilationReference compilationReference = compilation1.ToMetadataReference(); 48519CompilationReference compilationReference = compilation1.ToMetadataReference(); 48591CompilationReference compilationReference = compilation1.ToMetadataReference(); 48663CompilationReference compilationReference = compilation1.ToMetadataReference(); 48733CompilationReference compilationReference = compilation1.ToMetadataReference(); 48803CompilationReference compilationReference = compilation1.ToMetadataReference(); 48896CompilationReference compilationReference = compilation1.ToMetadataReference(); 48962CompilationReference compilationReference = compilation1.ToMetadataReference(); 49069CompilationReference compilationReference = compilation1.ToMetadataReference(); 49301CompilationReference compilationReference = compilation1.ToMetadataReference(); 49541CompilationReference compilationReference = compilation1.ToMetadataReference();
Symbols\Metadata\PE\NoPia.cs (2)
1386var referencePIASource = compilationPIA.ToMetadataReference(embedInteropTypes: true); 1392var referenceBaseSource = compilationBase.ToMetadataReference();
Symbols\ModuleInitializers\ModuleInitializersTests.cs (2)
1098var ref1 = CreateCompilation(source1).ToMetadataReference(aliases: ImmutableArray.Create("Alias1")); 1099var ref2 = CreateCompilation(source1).ToMetadataReference(aliases: ImmutableArray.Create("Alias2"));
Symbols\RequiredMembersTests.cs (4)
2252var originalCRef = originalC.ToMetadataReference(); 2267var baseRef = baseComp.ToMetadataReference(); 6272var reference = CreateCompilationWithRequiredMembers("").ToMetadataReference(); 6291var reference = CreateCompilationWithRequiredMembers("").ToMetadataReference();
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (1)
450var ref1 = CreateEmptyCompilation("").ToMetadataReference();
Symbols\Retargeting\RetargetingTests.cs (3)
936var retargeted1Ref = retargeted1.ToMetadataReference(); 938var retargeted2Ref = retargeted2.ToMetadataReference(); 941var consistentRef = consistent.ToMetadataReference();
Symbols\Source\FileModifierTests.cs (1)
4549var reference = comp0.ToMetadataReference();
Symbols\Source\PropertyTests.cs (1)
2628var compRef = refComp.ToMetadataReference(embedInteropTypes: false);
Symbols\TypeTests.cs (1)
743var refAsm = CreateCompilation(refSource, assemblyName: "RefAsm").ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7370var compRef = verifier.Compilation.ToMetadataReference();
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Workspaces\TryFindSourceDefinitionTests.vb (1)
257Assert.IsAssignableFrom(Of CompilationReference)(retargetingCompilation.GetMetadataReference(retargetedClass.ContainingAssembly))
Microsoft.CodeAnalysis.Features (1)
UnusedReferences\UnusedReferencesRemover.cs (1)
55.OfType<CompilationReference>()
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\CompilationExtensions.cs (1)
460/// up <see cref="CompilationReference"/> which contains all of the well known types that were used from that
Compilation\IRuntimeEnvironment.cs (3)
98if (metadataReference is CompilationReference) 185foreach (var reference in compilation.References.OfType<CompilationReference>())
Microsoft.CodeAnalysis.UnitTests (11)
MetadataReferences\MetadataReferenceTests.cs (11)
341var r = c.ToMetadataReference(); 346var r1 = r.WithAliases(new[] { "a", "b" }); 352var r2 = r.WithEmbedInteropTypes(true); 358var r3 = r.WithProperties(new MetadataReferenceProperties(MetadataImageKind.Assembly, ImmutableArray.Create("x"), embedInteropTypes: true)); 372var r = c.ToMetadataReference(); 377var r1 = r.WithAliases(new[] { "a", "b" }); 383var r2 = r.WithEmbedInteropTypes(true); 389var r3 = r.WithProperties(new MetadataReferenceProperties(MetadataImageKind.Assembly, ImmutableArray.Create("x"), embedInteropTypes: true)); 539var c1a = CS.CSharpCompilation.Create("goo").ToMetadataReference(); 540var c1b = c1a.Compilation.ToMetadataReference(); 541var c2 = CS.CSharpCompilation.Create("goo").ToMetadataReference();
Microsoft.CodeAnalysis.VisualBasic (3)
Compilation\VisualBasicCompilation.vb (1)
1362Public Overrides Function ToMetadataReference(Optional aliases As ImmutableArray(Of String) = Nothing, Optional embedInteropTypes As Boolean = False) As CompilationReference
Compilation\VisualBasicCompilationReference.vb (1)
124Friend Overrides Function WithPropertiesImpl(properties As MetadataReferenceProperties) As CompilationReference
Symbols\ReferenceManager.vb (1)
110Protected Overrides Function CreateAssemblyDataForCompilation(compilationReference As CompilationReference) As AssemblyData
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (2)
Attributes\InternalsVisibleToAndStrongNameTests.vb (2)
2558Dim compilationReference As CompilationReference = other.ToMetadataReference() 2675Dim compilationReference As CompilationReference = other.ToMetadataReference()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
SymbolsTests\Retargeting\NoPia.vb (1)
571Private Sub CyclicReference(piaRef As MetadataReference, localTypes1Ref As CompilationReference)
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (2)
27foreach (var reference in compilation.References.OfType<CompilationReference>())
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
231Assert.True(compilation1.References.OfType<CompilationReference>().Any(c => c.Compilation == compilation2) || 232compilation2.References.OfType<CompilationReference>().Any(c => c.Compilation == compilation1)); 3223Assert.Single(compilation.References.OfType<CompilationReference>());
Microsoft.CodeAnalysis.Workspaces.UnitTests (15)
SolutionTests\SolutionTests.cs (12)
2864if (referencedMetadata is CompilationReference compilationReference) 2868var cr = r as CompilationReference; 5001Assert.True(compilation1.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation2)); 5029Assert.True(compilation2.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation1)); 5126Assert.True(compilation1New.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation2)); 5127Assert.True(compilation1New.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation3)); 5174Assert.True(compilation1.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation2)); 5175Assert.True(compilation1.References.Any(r => r is CompilationReference compilationReference && compilationReference.Compilation == compilation3)); 5190Assert.True(compilation1New.References.All(r => r is not CompilationReference)); 5219Assert.False(compilation1.References.Any(r => r is CompilationReference)); 5698Assert.Single(frozenCompilation2.References.Where(r => r is CompilationReference c && c.Compilation == frozenCompilation1));
SolutionTests\SolutionWithSourceGeneratorTests.cs (3)
431var compilationReference = Assert.IsAssignableFrom<CompilationReference>(Assert.Single(compilationWithReference.References)); 681var compilationReference = Assert.Single(compilationWithReference.References.OfType<CompilationReference>());