Base:
method
ToMetadataReference
Microsoft.CodeAnalysis.Compilation.ToMetadataReference(System.Collections.Immutable.ImmutableArray<System.String>, System.Boolean)
1376 references to ToMetadataReference
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineIVTTests.cs (4)
39}, additionalReferences: new[] { comp1.ToMetadataReference() }); 116}, additionalReferences: new[] { comp1.ToMetadataReference() }); 195}, additionalReferences: new[] { comp1.ToMetadataReference() }); 280}, additionalReferences: new[] { comp1.ToMetadataReference() });
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (164)
CodeGen\CodeGenAsyncIteratorTests.cs (4)
8635var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: TargetFramework.Net80); 8678var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: TargetFramework.Net80); 10499", assemblyName: "libS1", targetFramework: TargetFramework.Net80).ToMetadataReference(); 10506", references: [missingLibS1], assemblyName: "libS2", targetFramework: TargetFramework.Net80).ToMetadataReference();
CodeGen\CodeGenAsyncMainTests.cs (4)
381var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 421var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
CodeGen\CodeGenDeconstructTests.cs (4)
7864Handler", references: WinRtRefs.Concat(new[] { ValueTupleRef, comp1.ToMetadataReference() })); 7927Handler", references: WinRtRefs.Concat(new[] { ValueTupleRef, comp1.ToMetadataReference() })); 8476var lib = CreateCompilationWithMscorlib461(lib_cs, references: new[] { missing.ToMetadataReference() }, options: TestOptions.DebugDll); 8490var comp = CreateCompilationWithMscorlib461(source, references: new[] { lib.ToMetadataReference() }, options: TestOptions.DebugDll); // no ValueTuple reference
CodeGen\CodeGenFunctionPointersTests.cs (1)
8666validate(comp0.ToMetadataReference());
CodeGen\CodeGenInParametersTests.cs (5)
2796CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "9"); 2827CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "9"); 2858CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "9"); 2888CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "False"); 2918CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "3");
CodeGen\CodeGenIterators.cs (2)
4152", assemblyName: "libS1").ToMetadataReference(); 4159", references: [missingLibS1], assemblyName: "libS2").ToMetadataReference();
CodeGen\CodeGenReadonlyStructTests.cs (1)
1564var comp2 = CreateCompilation("", references: new[] { externalComp.ToMetadataReference() });
CodeGen\CodeGenTests.cs (1)
13509var comp = CreateCompilation(code, references: new[] { reference.ToMetadataReference() });
CodeGen\CodeGenTupleTest.cs (97)
353references: new[] { comp1.ToMetadataReference() }); 408references: new[] { SystemRuntimeFacadeRef, ValueTupleRef, comp1.ToMetadataReference() }); 1690var compLibCompilationRef = compLib.ToMetadataReference(); 3769references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, missingComp.ToMetadataReference() }); 3773references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, libComp.ToMetadataReference() }, parseOptions: TestOptions.Regular); 3785references: new[] { ValueTupleRef, SystemRuntimeFacadeRef, libComp.ToMetadataReference() }, parseOptions: TestOptions.Regular7_1); 5523var comp = CreateCompilationWithMscorlib40(source, references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference() }); 5532references: new[] { comp1.ToMetadataReference() }, 5814var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5851var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5868var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 5903var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6049var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6184var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6362var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6381var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 6541var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 13915var comp2CompilationRef = comp2.ToMetadataReference(); 14080var comp2CompilationRef = comp2.ToMetadataReference(); 14504var comp2 = CreateCompilationWithMscorlib40(source2, references: new[] { comp1.ToMetadataReference() }, 14772var consumer1 = CreateCompilationWithMscorlib40(source, options: TestOptions.ReleaseExe, references: new[] { lib.ToMetadataReference() }); 15033var consumer1 = CreateCompilationWithMscorlib40(source, options: TestOptions.ReleaseExe, references: new[] { lib.ToMetadataReference() }); 15419var consumer1 = CreateCompilationWithMscorlib46(source, options: TestOptions.ReleaseExe, references: new[] { lib.ToMetadataReference() }); 15680var consumer1 = CreateCompilationWithMscorlib46(source, options: TestOptions.ReleaseExe, references: new[] { lib.ToMetadataReference() }); 16767var comp1 = CreateCompilation(source, references: new[] { libComp.ToMetadataReference() }); 16792references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference() }, 16803references: new[] { comp2.ToMetadataReference(), comp1.ToMetadataReference() }, 16814references: new[] { comp2.ToMetadataReference(ImmutableArray.Create("alias")), comp1.ToMetadataReference() }, 16854references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference() }, 16865references: new[] { comp1.ToMetadataReference().WithAliases(ImmutableArray.Create("alias")), comp2.ToMetadataReference() }, 16886references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")) }, 16926references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference() }, 16940references: new[] { comp1.ToMetadataReference().WithAliases(ImmutableArray.Create("alias")), comp2.ToMetadataReference() }, 16961references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")) }, 17023references: s_valueTupleRefs.Concat(new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")) }), 17046references: s_valueTupleRefs.Concat(new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")) }), 17069comp1.ToMetadataReference(), 17070comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")), 17124references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")) }, 17178references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference().WithAliases(ImmutableArray.Create("alias1")) }, 17480var comp = CompileAndVerifyWithMscorlib40(source, expectedOutput: "(1, 2)", references: new[] { tupleComp.ToMetadataReference() }); 18841var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18859var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18879var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18902var comp = CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18919var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18945var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 18970var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 18995var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 19021var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 19059var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { (MetadataReference)Net40.References.mscorlib, tupleComp1.ToMetadataReference() }); 19098var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { (MetadataReference)Net40.References.mscorlib, tupleComp1.ToMetadataReference() }); 19137var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { MscorlibRef, tupleComp1.ToMetadataReference() }); 19176var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { MscorlibRef, tupleComp1.ToMetadataReference() }); 22274var comp = CreateCompilationWithMscorlib40(source, references: new[] { lib.ToMetadataReference() }); 22314var comp = CreateCompilationWithMscorlib40(source, references: new[] { lib.ToMetadataReference() }); 22394references: new[] { comp1.ToMetadataReference(), comp2.ToMetadataReference() }, 22481var comp = CreateCompilationWithMscorlib40(source, references: new[] { compLib.ToMetadataReference() }); 23446var comp = CompileAndVerify(source, expectedOutput: "42qq", references: new[] { libComp.ToMetadataReference() }, options: TestOptions.DebugExe, verify: Verification.Fails); 24851var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }); 26422var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26466var missingContainerRef = useImageReference ? missingContainer.EmitToImageReference() : missingContainer.ToMetadataReference(); 26484var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26529var missingContainerRef = useImageReference ? missingContainer.EmitToImageReference() : missingContainer.ToMetadataReference(); 26543var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26590var missingRef = useImageReference ? missing.EmitToImageReference() : missing.ToMetadataReference(); 26608var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 26696var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to vt 26862var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container 26937var compWithMetadataReference = CreateEmptyCompilation(client_cs, references: new[] { MscorlibRef, lib.ToMetadataReference() }); // missing reference to container 27043var comp1Ref = new[] { comp1.ToMetadataReference() }; 27127var comp1Ref = new[] { comp1.ToMetadataReference() }; 27201var comp1Ref = new[] { comp1.ToMetadataReference() }; 27279var comp1Ref = new[] { comp1.ToMetadataReference() }; 27977var comp3 = CreateCompilation("", references: new[] { comp.ToMetadataReference() }, targetFramework: TargetFramework.Mscorlib46); 28189var comp2 = CreateCompilation("", targetFramework: TargetFramework.Mscorlib46, references: new[] { comp.ToMetadataReference() }); 28303var comp2 = CreateCompilation("", targetFramework: TargetFramework.Mscorlib46, references: new[] { comp.ToMetadataReference() }); 28392var comp3 = CreateCompilation("", references: new[] { comp.ToMetadataReference() }, targetFramework: TargetFramework.Mscorlib46);
CodeGen\FixedSizeBufferTests.cs (1)
1155var comp3 = CreateCompilation("", references: new[] { comp.ToMetadataReference() }, targetFramework: TargetFramework.Mscorlib46);
CodeGen\IndexerTests.cs (1)
1240var comp2 = CreateCompilation(text2, references: [comp1.ToMetadataReference()]);
Emit\CompilationEmitTests.cs (2)
1037var piaMetadataReference = pia.ToMetadataReference(embedInteropTypes: true); 1116var piaMetadataReference = pia.ToMetadataReference(embedInteropTypes: true);
Emit\InAttributeModifierTests.cs (41)
42var verifier = CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 78CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 102CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 129CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 153CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 179CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 206CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 2532CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2579CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2634CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2682CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2729CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2774CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2819CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2864CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2909CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2954CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 2999CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3045CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3091CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3137CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3183CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3231CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3279CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3334CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3382CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3430CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3476CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3522CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3568CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3614CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3660CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5", symbolValidator: validator); 3693CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 3726CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 3769CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 3811CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 4200CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.ToMetadataReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4247CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.ToMetadataReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4296CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.ToMetadataReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4348CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.ToMetadataReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator); 4401CompileAndVerify(source: userCode, expectedOutput: "5", references: new[] { testRef.ToMetadataReference() }, options: TestOptions.ReleaseExe, symbolValidator: validator);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (24)
Emit\EditAndContinue\AssemblyReferencesTests.cs (10)
211var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll); 212var compilation1 = compilation0.WithSource(src1).WithReferences(new[] { MscorlibRef, lib1.ToMetadataReference() }); 213var compilation2 = compilation1.WithSource(src2).WithReferences(new[] { MscorlibRef, lib2.ToMetadataReference() }); 315var compilation0 = CreateEmptyCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll); 316var compilation1 = compilation0.WithSource(src1).WithReferences(new[] { MscorlibRef, lib1.ToMetadataReference() }); 317var compilation2 = compilation1.WithSource(src2).WithReferences(new[] { MscorlibRef, lib2.ToMetadataReference() }); 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\EditAndContinue\SymbolMatcherTests.cs (2)
307var compilation0 = CreateCompilation(source, new[] { lib0.ToMetadataReference() }, options: TestOptions.DebugDll); 308var compilation1 = compilation0.WithSource(source).WithReferences(MscorlibRef, lib1.ToMetadataReference());
Emit\NumericIntPtrTests.cs (7)
938var ref1 = comp.ToMetadataReference(); 1000var ref1 = comp.ToMetadataReference(); 1193var ref1 = comp.ToMetadataReference(); 3056var ref1 = comp.ToMetadataReference(); 10333comp = CreateEmptyCompilation(source, references: new[] { corlib.ToMetadataReference() }, parseOptions: parseOptions); 10921var comp = CreateCompilation(source, references: new[] { libComp.ToMetadataReference() }, targetFramework: TargetFramework.Net70); 10952var comp = CreateEmptyCompilation(source, references: new[] { libComp.ToMetadataReference(), MscorlibRef_v46 });
PDB\PDBUsingTests.cs (5)
678compilation1.ToMetadataReference(), 680compilation1.ToMetadataReference(ImmutableArray.Create("X")) 731compilation1.ToMetadataReference(ImmutableArray.Create("X")), 733compilation1.ToMetadataReference(), 2851var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }, options: TestOptions.DebugExe);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (267)
Attributes\AttributeTests.cs (20)
122var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference() }, assemblyName: "lib"); 159var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference() }, assemblyName: "lib"); 199var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference() }, assemblyName: "lib"); 244var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference() }, assemblyName: "lib"); 282references: new[] { compWithReferenceToLib.ToMetadataReference(), newComp.ToMetadataReference() }, assemblyName: "lib"); 317var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference(), newComp.ToMetadataReference() }, assemblyName: "lib"); 392references: new[] { compWithReferenceToLib.ToMetadataReference(), newComp.ToMetadataReference() }, assemblyName: "lib"); 428var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference(), newComp.ToMetadataReference() }, assemblyName: "lib"); 463var newLibComp2 = CreateCompilation(newLib_cs, references: new[] { compWithReferenceToLib.ToMetadataReference(), newComp.ToMetadataReference() }, assemblyName: "lib"); 994CreateCompilation(usageSource, references: new[] { definitionComp.ToMetadataReference() }, options: WithNullableEnable()) 8451var comp1 = CreateCompilationWithMscorlib40(source2, assemblyName: "Temp0").ToMetadataReference(); 8476comp1 = CreateCompilationWithMscorlib40(source2, assemblyName: "Temp1").ToMetadataReference(); 8477var comp2 = CreateEmptyCompilation(source3, assemblyName: "Temp2").ToMetadataReference(); 10466var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }, parseOptions: TestOptions.Regular9); 10537var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }, parseOptions: TestOptions.Regular9);
Attributes\AttributeTests_Assembly.cs (1)
1520var defsRef = CreateCompilationWithMscorlib40(defaultHeaderString + s_defaultNetModuleSourceBody).ToMetadataReference();
Attributes\AttributeTests_Conditional.cs (2)
269CompileAndVerify(source2, references: new[] { comp1.ToMetadataReference() }, sourceSymbolValidator: CommonSourceValidatorForCondAttrType, symbolValidator: CommonMetadataValidatorForCondAttrType, expectedOutput: ""); 480CompileAndVerify(source2, references: new[] { comp1.ToMetadataReference() }, expectedOutput: s_commonExpectedOutput_ConditionalMethodsTest);
Attributes\AttributeTests_Dynamic.cs (1)
967var customRef = CreateCompilationWithMscorlib46(customDynamicAttrSource).ToMetadataReference();
Attributes\AttributeTests_Embedded.cs (4)
79CreateCompilation(code, references: new[] { reference.ToMetadataReference() }, assemblyName: "Source").VerifyDiagnostics( 159CreateCompilation(code, references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 250}", assemblyName: "reference").ToMetadataReference(); 278}").ToMetadataReference();
Attributes\AttributeTests_IsByRefLike.cs (12)
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(); 368}", references: new[] { code1.ToMetadataReference() }, options: options); 381}", references: new[] { code2.ToMetadataReference() }, options: options); 432}").ToMetadataReference(); 608var compilation_CompilationReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.ToMetadataReference(embedInteropTypes: true) }); 929CreateCompilation(text, new[] { libComp.ToMetadataReference() }).VerifyEmitDiagnostics(
Attributes\AttributeTests_IsUnmanaged.cs (2)
636", references: new[] { code1.ToMetadataReference() }, options: options); 645", references: new[] { code2.ToMetadataReference() }, options: options);
Attributes\AttributeTests_Nullable.cs (3)
43Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 108Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 206Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference();
Attributes\AttributeTests_ReadOnlyStruct.cs (11)
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(); 358}", references: new[] { code1.ToMetadataReference() }, options: options); 371}", references: new[] { code2.ToMetadataReference() }, options: options); 422}").ToMetadataReference(); 600var compilation_CompilationReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.ToMetadataReference(embedInteropTypes: true) });
Attributes\AttributeTests_RefReadOnly.cs (25)
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(); 1063}", references: new[] { code1.ToMetadataReference() }, options: options); 1076}", references: new[] { code2.ToMetadataReference() }, options: options); 1148}").ToMetadataReference(); 1327var compilation_CompilationReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.ToMetadataReference(embedInteropTypes: true) }); 1371}", references: new[] { reference.ToMetadataReference() }); 1413}", references: new[] { reference.ToMetadataReference() }); 1508}", references: new[] { reference.ToMetadataReference() }); 1755}", assemblyName: "testRef").ToMetadataReference(); 1844}").ToMetadataReference(); 2002}").ToMetadataReference(); 2088}").ToMetadataReference();
Attributes\AttributeTests_WellKnownAttributes.cs (17)
3847CompileAndVerify(source2, references: new[] { compDll.ToMetadataReference() }, expectedOutput: expectedOutput); 3955CompileAndVerify(source2, references: new[] { compDll.ToMetadataReference() }, expectedOutput: expectedOutput); 4026CreateCompilation(source2, references: new[] { compDll.ToMetadataReference() }).VerifyDiagnostics( 4105CreateCompilation(source2, references: new[] { compDll.ToMetadataReference() }).VerifyDiagnostics( 4183CreateCompilation(source2, references: new[] { compDll.ToMetadataReference() }).VerifyDiagnostics( 4268CreateCompilation(source2, references: new[] { compDll.ToMetadataReference() }).VerifyDiagnostics( 4890var client1 = CreateCompilation("", references: new[] { lib_comp.ToMetadataReference() }); 8601verify(comp1.ToMetadataReference()); 8656verify(comp1.ToMetadataReference()); 8700verify(comp1.ToMetadataReference()); 8743verify(comp1.ToMetadataReference()); 8842verifyReference(comp1.ToMetadataReference(), options, expectedDiagnostics); 8895verify(comp1.ToMetadataReference()); 8943verify(comp1.ToMetadataReference()); 9022verify(comp1.ToMetadataReference()); 9177verify(comp1.ToMetadataReference()); 9506verify(comp1.ToMetadataReference());
Attributes\InternalsVisibleToAndStrongNameTests.cs (6)
1472references: new[] { comp.ToMetadataReference() }, 2976var comp = CreateCompilation(source1, new[] { lib.ToMetadataReference() }, assemblyName: "Issue57742_01"); 3011var comp = CreateCompilation(source1, new[] { lib.ToMetadataReference() }, assemblyName: "Issue57742_02"); 3052CompilationReference compilationReference = lib.ToMetadataReference(); 3176CompilationReference compilationReference = lib.ToMetadataReference(); 3243var comp = CreateCompilation(source1, new[] { lib.ToMetadataReference() }, assemblyName: "Issue57742_05");
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1884var metadataReference = CreateCompilation(source).ToMetadataReference();
FirstClassSpanTests.cs (1)
2778.ToMetadataReference();
OverloadResolutionPriorityTests.cs (5)
258var derivedReference = useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference(); 307var derivedReference = useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference(); 690var comp3 = CreateCompilation(source3, references: [comp2.ToMetadataReference(), comp1_2.ToMetadataReference()], targetFramework: TargetFramework.Standard); 750var comp3 = CreateCompilation(source3, references: [comp2.ToMetadataReference(), comp1_2.ToMetadataReference()], targetFramework: TargetFramework.Standard); 798var comp3 = CreateCompilation(source3, references: [comp2.ToMetadataReference(), comp1_2.ToMetadataReference()]);
RefReadonlyParameterTests.cs (14)
1560var comp1Ref = comp1.ToMetadataReference(); 3167var comp1Ref = comp1.ToMetadataReference(); 6675var comp1v1Ref = emit ? comp1v1.EmitToImageReference() : comp1v1.ToMetadataReference(); 6684var comp1v2Ref = emit ? comp1v2.EmitToImageReference() : comp1v2.ToMetadataReference(); 6693var comp2Ref = emit ? comp2.EmitToImageReference() : comp2.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 (90)
646MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 950MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 1064MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 1545MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 1640MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 2121MetadataReference[] comp1Refs = [comp1.EmitToImageReference(), comp1.ToMetadataReference()]; 5477CreateCompilation(src2, references: [comp2.ToMetadataReference()], targetFramework: TargetFramework.Net70).VerifyDiagnostics( 5610CreateCompilation(src2, references: [comp2.ToMetadataReference()], targetFramework: TargetFramework.Net70).VerifyDiagnostics( 6150var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 6212var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 6270var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 6338var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 6406var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 6475var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 7275var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 7278comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 7281comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 7321var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 7338comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 7341comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 7359var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 7362comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 7365comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 8687var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 8690comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 8693comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 8729var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 8746comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 8749comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 8763var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 8766comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 8769comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 8828var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 8835comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 8838comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 11757var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 11760comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 11763comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 11813var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 11827comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 11830comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 11842var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 11845comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 11848comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 13707var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 13717comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 13720comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 13765var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 13794comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 13797comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 13815var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 13818comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 13821comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 16140var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 16143comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 16146comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 16182var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 16199comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 16202comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 16216var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 16219comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 16222comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 16286var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 16293comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 16296comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 17392var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 17399comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 17408comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 17468var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 17488comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 17495comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 17511var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 17514comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 17517comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 18904var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 18907comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 18910comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 18944var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 18958comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 18961comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 18975var comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 18978comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 18981comp3 = CreateCompilation(src3, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 19040var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular12); 19047comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics, parseOptions: TestOptions.Regular13); 19050comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: s_targetFrameworkSupportingByRefLikeGenerics); 20048var comp1Ref = CreateCompilation(src1, targetFramework: s_targetFrameworkSupportingByRefLikeGenerics).ToMetadataReference(); 20105comp1Ref = CreateCompilation(src1, targetFramework: TargetFramework.Mscorlib461Extended).ToMetadataReference(); 20305var comp1Ref = CreateCompilation(src1, targetFramework: s_targetFrameworkSupportingByRefLikeGenerics).ToMetadataReference(); 20362comp1Ref = CreateCompilation(src1, targetFramework: TargetFramework.Mscorlib461Extended).ToMetadataReference();
Semantics\CollectionExpressionTests.cs (2)
7654var refA = comp.ToMetadataReference(); 19420var refA = comp.ToMetadataReference();
Semantics\ExperimentalAttributeTests.cs (12)
935var derivedComp = CreateCompilation(derivedSrc, new[] { originalC.ToMetadataReference(), attrRef }, targetFramework: TargetFramework.Standard); 938var comp = CreateCompilation("_ = new Derived();", new[] { derivedComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 970var derivedComp = CreateCompilation(derivedSrc, new[] { originalC.ToMetadataReference(), attrRef }, targetFramework: TargetFramework.Standard); 973var comp = CreateCompilation("_ = new Derived();", new[] { derivedComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 1000var derivedComp = CreateCompilation(@base, new[] { originalC.ToMetadataReference(), attrRef }, targetFramework: TargetFramework.Standard); 1003var comp = CreateCompilation("_ = new Derived();", new[] { derivedComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 1035var derivedComp = CreateCompilation(@base, new[] { originalC.ToMetadataReference(), attrRef }, targetFramework: TargetFramework.Standard); 1038var comp = CreateCompilation("_ = new Derived();", new[] { derivedComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard);
Semantics\InlineArrayTests.cs (3)
1166var comp2 = CreateCompilation("", references: new[] { comp1.ToMetadataReference() }, targetFramework: TargetFramework.Net60); 2175var comp2 = CreateCompilation(src2, references: new[] { comp1.ToMetadataReference() }, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe); 2299var comp2 = CreateCompilation(src2, references: new[] { comp1.ToMetadataReference() }, targetFramework: TargetFramework.Net80, options: TestOptions.DebugExe);
Semantics\ParamsCollectionTests.cs (26)
1022var builder = CreateCompilation(builderSource, references: [myCollection_v0.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseDll); 1037var myCollection = CreateCompilation(myCollectionSource, references: [builder.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseDll, assemblyName: "Collection"); 4018verify(comp1.ToMetadataReference()); 4085verify(comp1.ToMetadataReference()); 4200verify(comp1.ToMetadataReference()); 4324verify(comp1.ToMetadataReference()); 4400verify(comp1.ToMetadataReference()); 4446var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseExe); 4450var comp4 = CreateCompilation(src2, references: [comp3.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseExe); 4453var comp5 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseModule); 4515var comp2 = CreateCompilation(src, references: [comp1.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseExe.WithMetadataImportOptions(MetadataImportOptions.All)); 4668var comp2 = CreateCompilation(src, references: [comp1.ToMetadataReference()], targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseExe.WithMetadataImportOptions(MetadataImportOptions.All)); 4742var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 4771var comp2 = CreateCompilation(src2, references: [comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 12765var comp1Ref = comp1.ToMetadataReference(); 12789var comp5Ref = comp5.ToMetadataReference(); 13157var compilation_CompilationReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.ToMetadataReference(embedInteropTypes: true) }); 13217var compilation_CompilationReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comAssembly.ToMetadataReference(embedInteropTypes: true) }); 13280var compilation_CompilationReference = CreateCompilationWithMscorlib40(code, options: options, references: new[] { comp1Ref, comAssembly.ToMetadataReference(embedInteropTypes: true) }); 13344var comp2 = CreateCompilation(src2, references: [image ? comp1.EmitToImageReference() : comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 13410var comp2 = CreateCompilation(src2, references: [image ? comp1.EmitToImageReference() : comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 13474var comp2 = CreateCompilation(src2, references: [image ? comp1.EmitToImageReference() : comp1.ToMetadataReference()], options: TestOptions.ReleaseExe); 13554var comp4 = CreateCompilation(source4, references: [comp1Ref, comp3.ToMetadataReference()], options: TestOptions.ReleaseExe); 13579var comp5 = CreateCompilation(source5, references: [comp1Ref, comp3.ToMetadataReference()], options: TestOptions.UnsafeReleaseExe); 13655var comp4 = CreateCompilation(source4, references: [comp1Ref, comp3.ToMetadataReference()], options: TestOptions.ReleaseExe); 13680var comp5 = CreateCompilation(source5, references: [comp1Ref, comp3.ToMetadataReference()], options: TestOptions.UnsafeReleaseExe);
Semantics\RecordTests.cs (9)
9801var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference(); 10571var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference(); 12615var refA = useCompilationReference ? compA.ToMetadataReference() : compA.EmitToImageReference(); 13303var refA = compA.ToMetadataReference(); 20719CompileAndVerify(source2, references: new[] { useImageReference ? comp1.EmitToImageReference() : comp1.ToMetadataReference() }, expectedOutput: 20898references: new[] { emitRef ? comp.EmitToImageReference() : comp.ToMetadataReference() }, 21068references: new[] { emitRef ? comp.EmitToImageReference() : comp.ToMetadataReference() }, 23845var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference(); 30233var refA = useCompilationReference ? compA.ToMetadataReference() : compA.EmitToImageReference();
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (6)
IOperation\IOperationTests_IArgument.cs (6)
1257var lib0 = CreateCompilation(source0).ToMetadataReference(); 1473var comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() }); 1519var comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() }); 1565var comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() }); 1610var comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() }); 1656var comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() });
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
532var portableLibRef = portableLib.ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (181)
Semantics\DelegateTypeTests.cs (12)
18828var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 18854var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 18940var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 18944comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 18948comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 18952comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 19065var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 19095var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 19133var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 19137comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 19141comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() }); 19205var comp2 = CreateCompilation(source2, new[] { comp1.ToMetadataReference() });
Semantics\ForEachTests.cs (3)
3470var comp2 = CreateEmptyCompilation(source2, new[] { comp1.ToMetadataReference() }, options: TestOptions.DebugDll); 3498var comp4 = CreateEmptyCompilation(source4, new[] { comp2.ToMetadataReference(), comp3.ToMetadataReference() });
Semantics\FunctionPointerTests.cs (1)
2120var comp = CreateCompilationWithIL("", il, references: new[] { cComp.ToMetadataReference() }, targetFramework: TargetFramework.NetCoreApp, options: TestOptions.UnsafeReleaseDll);
Semantics\GlobalUsingDirectiveTests.cs (19)
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(); 3369references: new[] { compWithReferenceToLib.ToMetadataReference(), newCompRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3377references: new[] { compWithReferenceToLib.ToMetadataReference(), newCompRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3389references: new[] { compWithReferenceToLib.ToMetadataReference(), newCompRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3405references: new[] { compWithReferenceToLib.ToMetadataReference(), newCompRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3421references: new[] { compWithReferenceToLib.ToMetadataReference(), newCompRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3437references: new[] { compWithReferenceToLib.ToMetadataReference(), newCompRef }, assemblyName: "lib", parseOptions: TestOptions.RegularPreview); 3454var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 3645var extCompRef = extComp.ToMetadataReference().WithAliases(new[] { "ext" }); 4514var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "A" });
Semantics\InitOnlyMemberTests.cs (19)
78references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 115references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 149references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 187references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 217references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 228references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 312var comp = CreateCompilation(source, parseOptions: TestOptions.Regular8, references: new[] { lib.ToMetadataReference() }, assemblyName: "comp"); 347references: new[] { useMetadataImage ? lib.EmitToImageReference() : lib.ToMetadataReference() }); 1046var comp = CreateCompilation(new[] { source, main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1051comp = CreateCompilation(new[] { main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1082var comp = CreateCompilation(new[] { main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1130var comp = CreateCompilation(new[] { source, main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1135comp = CreateCompilation(new[] { main }, references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1618references: new[] { emitImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 1814references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }); 2126references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }); 2231references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }); 3085references: new[] { emitAsImage ? libComp.EmitToImageReference() : libComp.ToMetadataReference() }, 4198var comp1Ref = new[] { comp1.ToMetadataReference() };
Semantics\InterpolationTests.cs (7)
1846foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 2262foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 7910CreateCompilation(@"C.M(1, " + expression + @");", new[] { comp.ToMetadataReference() }).VerifyDiagnostics( 7978comp = CreateCompilation(executableCode, new[] { dependency.ToMetadataReference() }); 8253foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 8310foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 8432foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() })
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\NonTrailingNamedArgumentsTests.cs (1)
336var verifier1 = CompileAndVerify(source, expectedOutput: "1 2.", parseOptions: TestOptions.Regular7_2, references: new[] { lib.ToMetadataReference() });
Semantics\NullableReferenceTypesTests.cs (55)
8517var comp2 = CreateCompilation(new[] { client }, options: WithNullableEnable(), references: new[] { c.ToMetadataReference() }); 8534comp2 = CreateCompilation(new[] { client }, options: WithNullableEnable(), references: new[] { c.ToMetadataReference() }); 14336foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 14388foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17185var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }, options: WithNullableEnable()); 61551" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }); 61602" }, options: WithNullableEnable(), references: new MetadataReference[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }); 77109references: new[] { c0.ToMetadataReference() }); 77150references: new[] { c0.ToMetadataReference() }); 77371c = CreateCompilation(new[] { source2 }, new[] { c1.ToMetadataReference() }, 77506c = CreateCompilation(new[] { source2 }, new[] { c1.ToMetadataReference() }, 77539c = CreateCompilation(new[] { source2 }, new[] { c1.ToMetadataReference() }, 77678c = CreateCompilation(new[] { source2 }, new[] { c1.ToMetadataReference() }, 77819c = CreateCompilation(new[] { source2 }, new[] { c1.ToMetadataReference() }, 77980c = CreateCompilation(new[] { source2 }, new[] { c1.ToMetadataReference() }, 98649var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular8); 98673var comp5 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp4.ToMetadataReference() }); 99337var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular8); 99361var comp5 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp4.ToMetadataReference() }); 99439var comp2 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 99456var comp4 = CreateCompilation(new[] { source2 }, options: WithNullableDisable(), references: new[] { comp1.ToMetadataReference() }); 99472var comp7 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp6.ToMetadataReference() }); 99475var comp9 = CreateCompilation(new[] { source2 }, options: WithNullableDisable(), references: new[] { comp6.ToMetadataReference() }); 100114var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings)); 100147var comp5 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp4.ToMetadataReference() }); 100159var comp6 = CreateCompilation(new[] { source2 }, references: new[] { comp4.ToMetadataReference() }); 100233var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings)); 100258var comp5 = CreateCompilation(new[] { source2 }, options: WithNullableEnable(), references: new[] { comp4.ToMetadataReference() }); 100264var comp6 = CreateCompilation(new[] { source2 }, references: new[] { comp4.ToMetadataReference() }); 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() }) 110997MetadataReference ref0 = comp.ToMetadataReference(); 112640MetadataReference ref0 = comp0.ToMetadataReference(); 112659ref0 = comp0.ToMetadataReference(); 116162var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116200var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116237var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116274var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116316var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116358var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116399var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116443var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116484var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116527var comp3 = CreateCompilation(source2, options: WithNullableEnable(), references: new[] { comp1.ToMetadataReference() }); 116645var compilation3 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MinCorlibRef }); 116686var compilation5 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference() }); 116754var compilation7 = CreateEmptyCompilation(source2, options: WithNullableEnable(TestOptions.ReleaseDll), references: new[] { compilation1.ToMetadataReference(), MscorlibRef }); 145018references: new[] { spanRef, defComp.ToMetadataReference() }, 155815var nullableAttrRef = useImageReference ? nullableAttrComp.EmitToImageReference() : nullableAttrComp.ToMetadataReference(); 155834var libRef = useImageReference ? lib.EmitToImageReference() : lib.ToMetadataReference(); 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\OverloadResolutionTests.cs (2)
9576var comp1Ref = comp1.ToMetadataReference(); 11532CreateCompilation(code, references: new[] { libComp.ToMetadataReference() }).VerifyDiagnostics(
Semantics\RawInterpolationTests_Handler.cs (7)
214foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 632foreach (var reference in new[] { comp1.EmitToImageReference(), comp1.ToMetadataReference() }) 6093CreateCompilation(@"C.M(1, " + expression + @");", new[] { comp.ToMetadataReference() }).VerifyDiagnostics( 6164comp = CreateCompilation(executableCode, new[] { dependency.ToMetadataReference() }); 6428foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 6487foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() }) 6611foreach (var d in new[] { dependency.EmitToImageReference(), dependency.ToMetadataReference() })
Semantics\RecordStructTests.cs (2)
510var comp2 = CreateCompilation("", targetFramework: TargetFramework.Mscorlib46, references: new[] { comp.ToMetadataReference() }); 5085CompileAndVerify(source2, references: new[] { useImageReference ? comp1.EmitToImageReference() : comp1.ToMetadataReference() }, expectedOutput: @"
Semantics\RefEscapingTests.cs (2)
8755var comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() }, parseOptions: TestOptions.Regular11); 8765comp1 = CreateCompilation(source1, references: new[] { comp0.ToMetadataReference() }, parseOptions: TestOptions.Regular10);
Semantics\RefExtensionMethodsTests.cs (18)
395CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "55"); 437}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 481}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 525}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 565CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "55"); 607}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 651}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 940CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "55"); 982}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 1026}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 1070}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 1114}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 1158}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 1202}", references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 2328references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 2341CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5"); 2432references: new[] { reference.ToMetadataReference() }).VerifyDiagnostics( 2445CompileAndVerify(code, references: new[] { reference.ToMetadataReference() }, expectedOutput: "5");
Semantics\RefFieldTests.cs (3)
330var refA = comp.ToMetadataReference(); 11965var refA = comp.ToMetadataReference(); 23423var refA = comp.ToMetadataReference();
Semantics\ScriptSemanticsTests.cs (1)
89return taskCompilation.ToMetadataReference();
Semantics\StructConstructorTests.cs (2)
223var refA = comp.ToMetadataReference(); 3219var refA = comp.ToMetadataReference();
Semantics\UseSiteErrorTests.cs (7)
1046references: [NetFramework.mscorlib, delComp.ToMetadataReference()], 1060references: [NetFramework.mscorlib, lib1Comp.ToMetadataReference()], 2333var compilation3 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MinCorlibRef }); 2374var compilation5 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference() }); 2419var compilation7 = CreateEmptyCompilation(source2, parseOptions: parseOptions, options: TestOptions.ReleaseDll, references: new[] { compilation1.ToMetadataReference(), MscorlibRef }); 2462}", assemblyName: "libS1").ToMetadataReference(); 2469", references: new[] { UnmanagedUseSiteError_Ref1 }, assemblyName: "libS2").ToMetadataReference();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (721)
BadSymbolReference.cs (2)
806var comp3 = CreateEmptyCompilation(project3Source, new[] { MscorlibRef, comp1.ToMetadataReference(), comp2.ToMetadataReference() }, assemblyName: "Project3");
Compilation\CompilationAPITests.cs (8)
1180var compRef1 = comp1.ToMetadataReference(); 1181var compRef2 = comp2.ToMetadataReference(); 3421{accessibility} class C<T> {{}}", new[] { useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference() }); 3442{accessibility} class C<T> {{}}", new[] { useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference() }); 3470MetadataReference reference = useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference(); 3498MetadataReference reference = useMetadataReference ? referenceComp.ToMetadataReference() : referenceComp.EmitToImageReference(); 3545return useMetadataReference ? referenceComp1.ToMetadataReference() : referenceComp1.EmitToImageReference(); 3585return useMetadataReference ? referenceComp1.ToMetadataReference() : referenceComp1.EmitToImageReference();
Compilation\GetUnusedImportDirectivesTests.cs (4)
73var classLib2 = CreateCompilation(source: class2Source, assemblyName: "ClassLibrary2", references: new[] { classLib1.ToMetadataReference() }); 90var comp = CreateCompilation(tree, new[] { classLib1.ToMetadataReference(), classLib2.ToMetadataReference() }, assemblyName: "ConsoleApplication"); 245references: new[] { ivtCompilation.ToMetadataReference() },
Compilation\ReferenceManagerTests.cs (20)
51}", references: new MetadataReference[] { ifaceDef.ToMetadataReference(), wimpl }, 981var ref1 = lib1.ToMetadataReference(embedInteropTypes: true); 982var ref2 = lib2.ToMetadataReference(embedInteropTypes: false); 2249CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2266CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""0.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2267CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.1"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2268CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2269CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(), 2270CreateEmptyCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.1.0.0"")] public class C {}", new[] { MscorlibRef }, assemblyName: "C").ToMetadataReference(). 2291CreateCompilation(@"[assembly: System.Reflection.AssemblyVersion(""0.0.0.0"")] public class C {}", assemblyName: "C").ToMetadataReference(), 2292CreateCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.1"")] public class C {}", assemblyName: "C").ToMetadataReference(aliases: ImmutableArray.Create("X", "Y")), 2293CreateCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.0.0.0"")] public class C {}", assemblyName: "C").ToMetadataReference(), 2294CreateCompilation(@"[assembly: System.Reflection.AssemblyVersion(""2.0.0.0"")] public class C {}", assemblyName: "C").ToMetadataReference(), 2295CreateCompilation(@"[assembly: System.Reflection.AssemblyVersion(""1.1.0.0"")] public class C {}", assemblyName: "C").ToMetadataReference(). 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\SemanticModelAPITests.cs (2)
90references: new[] { comp1.ToMetadataReference() }); 95references: new[] { comp1.ToMetadataReference() });
Compilation\UsedAssembliesTests.cs (119)
71verify<RetargetingAssemblySymbol>(source2, comp1.ToMetadataReference()); 398verify<SourceAssemblySymbol>(source2, comp1.ToMetadataReference()); 432verify<RetargetingAssemblySymbol>(source2, comp1.ToMetadataReference()); 455var comp1Ref = comp1.ToMetadataReference(); 507var comp0Ref = comp0.ToMetadataReference(); 521var comp1Ref = comp1.ToMetadataReference(); 577var comp0Ref = comp0.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(); 1378verify<SourceAssemblySymbol>(source2, 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); 2461var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2496var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2512var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2584var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2600var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2672var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2688var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2756var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2773var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2845var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2861var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2933var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 2949var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 2997var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 3040var comp3Ref = comp3.ToMetadataReference(embedInteropTypes: false); 3306var comp0Ref = comp0.ToMetadataReference(embedInteropTypes: true); 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(); 5766var comp1Ref = comp1.ToMetadataReference(); 5806MetadataReference comp0Ref = comp0.ToMetadataReference(); 5843MetadataReference comp0Ref = comp0.ToMetadataReference(); 5878MetadataReference comp0Ref = comp0.ToMetadataReference(); 5916var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "N1C1" }); 5928var comp2Ref = comp2.ToMetadataReference(); 5957comp2Ref = comp2.ToMetadataReference().WithAliases(new[] { "N1C1" }); 6007var comp1Ref = comp1.ToMetadataReference().WithAliases(new[] { "N1C1" });
SymbolDisplay\SymbolDisplayTests.cs (1)
2182var comp2 = CreateCompilation("", references: [comp1.ToMetadataReference()], options: TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All));
Symbols\AnonymousTypesSymbolTests.cs (2)
1799var attributeLib = CreateEmptyCompilation(attributeSource, new[] { MinCorlibRef, stateLib.ToMetadataReference() }); 1811var comp = CreateEmptyCompilation(new[] { Parse(source), s_equalityComparerSourceTree }, new[] { MinCorlibRef, attributeLib.ToMetadataReference() });
Symbols\CheckedUserDefinedOperatorsTests.cs (10)
3443var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 3836var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 4218var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 4679var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 4798var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 5229var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 5697var compilation3 = CreateCompilation(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 6327var compilation3 = CreateCompilationWithCSharp(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 6432var compilation3 = CreateCompilationWithCSharp(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() }); 6551var compilation3 = CreateCompilationWithCSharp(source2, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular10, references: new[] { compilation2.ToMetadataReference() });
Symbols\CompilationCreationTests.cs (28)
716new MetadataReference[] { NetFramework.mscorlib, varC_MTTestLib1_V1.ToMetadataReference() }); 728varC_MTTestLib2.ToMetadataReference(), 729varC_MTTestLib1_V1.ToMetadataReference() 806varC_MTTestLib2.ToMetadataReference(), 807varC_MTTestLib1_V2.ToMetadataReference() 821varC_MTTestLib2.ToMetadataReference(), 822varC_MTTestLib1_V2.ToMetadataReference(), 823varC_MTTestLib3.ToMetadataReference() 943varC_MTTestLib2.ToMetadataReference(), varC_MTTestLib1_V3.ToMetadataReference(), varC_MTTestLib3.ToMetadataReference() }); 957varC_MTTestLib2.ToMetadataReference(), 958varC_MTTestLib1_V3.ToMetadataReference(), 959varC_MTTestLib3.ToMetadataReference(), 960varC_MTTestLib4.ToMetadataReference() 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() }); 1170varC_MTTestLib2.ToMetadataReference(), 1171varC_MTTestLib1_V3.ToMetadataReference(), 1172varC_MTTestLib3.ToMetadataReference(), 1173varC_MTTestLib4.ToMetadataReference() });
Symbols\CorLibrary\CorTypes.cs (28)
341var typeLib_v1_Comp = CreateEmptyCompilation(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib"); 352source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 390var comp = CreateCompilation(source2, references: [corLib_v2_Comp.ToMetadataReference(), typeLib_v2_Comp.ToMetadataReference(), comp1Ref], options: TestOptions.DebugExe); 394source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 519var typeLib_v1_Comp = CreateEmptyCompilation(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib"); 533source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 575var comp = CreateCompilation(source2, references: [corLib_v2_Comp.ToMetadataReference(), typeLib_v2_Comp.ToMetadataReference(), comp1Ref], options: TestOptions.DebugExe); 579source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 785var typeLib_v1_Comp = CreateEmptyCompilation(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib"); 806source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 856var comp = CreateCompilation(source2, references: [corLib_v2_Comp.ToMetadataReference(), typeLib_v2_Comp.ToMetadataReference(), comp1Ref], options: TestOptions.DebugExe); 863source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 980var typeLib_v1_Comp = CreateEmptyCompilation(typeLib_v1, references: [corLib_v1_Comp.ToMetadataReference()], assemblyName: "typeLib"); 1001source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()], 1050var comp = CreateCompilation(source2, references: [corLib_v2_Comp.ToMetadataReference(), typeLib_v2_Comp.ToMetadataReference(), comp1Ref], options: TestOptions.DebugExe); 1057source1, references: [corLib_v1_Comp.ToMetadataReference(), typeLib_v1_Comp.ToMetadataReference()],
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 (243)
166foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 345var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 485var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 1622var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 1676foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 1742foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 1819var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 1910var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 1928var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 2181var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 2265foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2267var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 2334foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2336var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 2407foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2409var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 2480foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 2482var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 2633var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 4277var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 4579var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 4675var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 4786var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 4802var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 5855var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 6126var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 6220var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 6236var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 6368var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 6598var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 7343var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 7559var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 7620var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 7696var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 7712var compilation3 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 9280foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 9470foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 9543var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 9842var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 9907var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 9992foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 10050var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 10058compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 10927var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 10999var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 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() }) 15674var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 15755var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 15862foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 15969var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 17527var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 17619var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 18326foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 18492foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 19908var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 19999var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 20424foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 24538var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 26567var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 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() }) 29183var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 29267var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 29374foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 29474var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 30930var compilation3 = CreateCompilation(source2, new[] { compilation2.ToMetadataReference() }, options: TestOptions.DebugExe, 31020var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 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() }) 32257var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe); 32547foreach (var reference in new[] { compilation3.ToMetadataReference(), compilation3.EmitToImageReference() }) 32975var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 33141var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 33227var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 33243CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 33307var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 33386var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 34157var compilation2 = CreateCompilation(source3, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 34194var compilation5 = CreateCompilation(source2 + source3, new[] { compilation4.ToMetadataReference() }, options: TestOptions.DebugDll, 34311var refs1 = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 34499var refs2 = new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }; 34689var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 34894var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 34973var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 35064var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 35165var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 35261var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 35366var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 35467foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35469var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 35576foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35578var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 35689foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35691var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 35802foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35804var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 35908foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 35910var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 36013foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36015var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 36111foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36113var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 36225foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 36227var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 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() }) 37002var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: options, 37291var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 37391var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 38418foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 38444foreach (var reference in new[] { compilation4.ToMetadataReference(), compilation4.EmitToImageReference() }) 38770var refs1 = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 38836var refs2 = new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }; 39008var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 39175var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 39510var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 40032var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 40242var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 40333var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 40423var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 40511var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, 41087var compilation2 = CreateCompilation(source3, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 41128var compilation5 = CreateCompilation(source2 + source3, new[] { compilation4.ToMetadataReference() }, options: TestOptions.DebugDll, 41267var refs1 = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 41498var refs2 = new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }; 41674var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 41851var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 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() }) 43834var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 43971var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 44101var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 44218var references = new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }; 45101var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 45254var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 45393var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 45585var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 45722var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugExe, 45899foreach (var refs in new[] { (comp0:compilation0.ToMetadataReference(), comp1:compilation1.ToMetadataReference()), 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() }) 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(); 49658foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 49774foreach (var reference in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() }) 50369var compilation1 = CreateCompilation(consumer, options: TestOptions.ReleaseDll, references: new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }, targetFramework: TargetFramework.Net50); 50409var compilation1 = CreateCompilation(consumer, options: TestOptions.ReleaseDll, references: new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }, targetFramework: TargetFramework.Net50); 50450var compilation1 = CreateCompilation(consumer, options: TestOptions.ReleaseDll, references: new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }, targetFramework: TargetFramework.Net50); 50490var compilation1 = CreateCompilation(consumer, options: TestOptions.ReleaseDll, references: new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }, targetFramework: TargetFramework.Net50); 50530var compilation1 = CreateCompilation(consumer, options: TestOptions.ReleaseDll, references: new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }, targetFramework: TargetFramework.Net50); 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) }) 50670var compilation1 = CreateCompilation(consumer, options: TestOptions.ReleaseDll, references: new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }, targetFramework: TargetFramework.Net50); 50753var compilation1 = CreateCompilation(consumer1, options: TestOptions.ReleaseDll, references: baseReferences.Concat(new[] { piaCompilation.ToMetadataReference(embedInteropTypes: true) }), targetFramework: TargetFramework.Empty); 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() }) 68529var compilation3 = CreateCompilation(source3, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 68548var compilation4 = CreateCompilation(source4, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 68592compilation3 = CreateCompilation(source3, new[] { compilation1.ToMetadataReference() }, 68605compilation4 = CreateCompilation(source4, new[] { compilation1.ToMetadataReference() }, 68688var compilation2 = CreateCompilation(source2, new[] { compilation1.ToMetadataReference() }, options: TestOptions.DebugDll, 68864foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() }) 68949foreach (var reference in new[] { compilation2.ToMetadataReference(), compilation2.EmitToImageReference() })
Symbols\ExtendedPartialMethodsTests.cs (7)
2089verify(comp1.ToMetadataReference()); 2235verify(comp1.ToMetadataReference()); 2242references: new[] { comp1.ToMetadataReference() }, 2278verify(comp1.ToMetadataReference()); 2321verify(comp1.ToMetadataReference()); 2362verify(comp1.ToMetadataReference()); 2483verify(comp1.ToMetadataReference());
Symbols\ImplicitClassTests.cs (1)
41var c2 = CreateCompilationWithMscorlib461("", new[] { c.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\RelaxedShiftOperatorTests.cs (1)
54var compilation2 = CreateCompilation(source1, options: TestOptions.DebugExe, references: new[] { compilation0.ToMetadataReference() },
Symbols\RequiredMembersTests.cs (42)
511comp = CreateCompilation(derived, references: new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 553MetadataReference baseReference = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 557comp = CreateCompilation(derivedDerived, new[] { baseReference, useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference() }); 599comp = CreateCompilation(derived, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 650var baseReference = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 655comp = CreateCompilation(derivedDerived, new[] { baseReference, useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference() }); 729var baseReference = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 802comp = CreateCompilation("#pragma warning disable CS0649 // Never assigned" + derived, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 1608comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 1635comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 1678comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 1703comp = CreateCompilation(creation, references: new[] { useMetadataReference ? cComp.ToMetadataReference() : cComp.EmitToImageReference() }); 2026comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2063var baseRef = useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference(); 2068comp = CreateCompilation(code, new[] { baseRef, useMetadataReference ? derivedComp.ToMetadataReference() : derivedComp.EmitToImageReference() }); 2120comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2153comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2184comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2203var baseComp = CreateCompilationWithRequiredMembers(@base, new[] { originalC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2217var comp = CreateCompilation(code, new[] { baseComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2252var originalCRef = originalC.ToMetadataReference(); 2267var baseRef = baseComp.ToMetadataReference(); 2276var comp = CreateCompilation(code, new[] { baseRef, derivedComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2298var baseComp = CreateCompilationWithRequiredMembers(@base, new[] { originalC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2312var comp = CreateCompilation(code, new[] { baseComp.ToMetadataReference(), retargetedC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2352comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2387comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2426comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2458comp = CreateCompilation(code, new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 2557var baseComp = CreateCompilationWithRequiredMembers(@base, new[] { originalC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2569var comp = CreateCompilation(code, new[] { baseComp.ToMetadataReference(), retargetedC.ToMetadataReference() }); 2588var baseComp = CreateCompilationWithRequiredMembers(@base, new[] { originalC.ToMetadataReference() }, targetFramework: TargetFramework.Standard); 2600var comp = CreateCompilation(code, new[] { baseComp.ToMetadataReference(), retargetedC.ToMetadataReference() }); 6587comp = CreateCompilation(code, references: new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 6666comp = CreateCompilation(code, references: new[] { useMetadataReference ? baseComp.ToMetadataReference() : baseComp.EmitToImageReference() }); 6967var reference = CreateCompilationWithRequiredMembers("").ToMetadataReference(); 6986var reference = CreateCompilationWithRequiredMembers("").ToMetadataReference();
Symbols\Retargeting\NoPia.cs (12)
1420new MetadataReference[] { comp.ToMetadataReference() }, 1465new MetadataReference[] { comp.ToMetadataReference() }, 1533references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) }); 1587references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) }); 1640references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) }); 1682references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) }); 1737references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true) }); 1776var lib = CreateCompilationWithMscorlib46(libSource, options: TestOptions.ReleaseDll, references: new[] { pia.ToMetadataReference() }); 1805references: new MetadataReference[] { pia.ToMetadataReference(embedInteropTypes: true), lib.ToMetadataReference() }); 2663foreach (MetadataReference piaRef in new[] { piaCompilation.EmitToImageReference(), piaCompilation.ToMetadataReference() }) 2667foreach (MetadataReference consumer1Ref in new[] { compilation1.EmitToImageReference(), compilation1.ToMetadataReference() })
Symbols\Retargeting\RetargetCustomAttributes.cs (5)
346var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }, options: TestOptions.DebugDll); 347var comp3 = CreateCompilation("", references: new[] { comp2.ToMetadataReference() }, options: TestOptions.DebugDll); 376var comp2 = CreateCompilation(source2, references: new[] { comp1_1.ToMetadataReference() }, options: TestOptions.DebugDll); 389var comp3 = CreateCompilation("", references: new[] { comp2.ToMetadataReference(), comp1_2.ToMetadataReference() }, options: TestOptions.DebugDll);
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (5)
450var ref1 = CreateEmptyCompilation("").ToMetadataReference(); 459var compilation2 = CreateCompilation(source2, references: new[] { compilation1.ToMetadataReference(), ref1, CreateEmptyCompilation("").ToMetadataReference() }); 461var compilation3 = CreateCompilation("", references: new[] { compilation1.ToMetadataReference(), compilation2.ToMetadataReference() });
Symbols\Retargeting\RetargetingTests.cs (10)
936var retargeted1Ref = retargeted1.ToMetadataReference(); 938var retargeted2Ref = retargeted2.ToMetadataReference(); 941var consistentRef = consistent.ToMetadataReference(); 979var retargetedComp = CreateCompilation("", references: new[] { originalComp.ToMetadataReference(), retargeted2Ref, consistentRef, ilRef }, 1059", new[] { beforeRetargeting.ToMetadataReference() }); 1065var finalComp = CreateEmptyCompilation(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() }); 1136", new[] { beforeRetargeting.ToMetadataReference() }); 1142var finalComp = CreateEmptyCompilation(@"C.M(1);", options: TestOptions.ReleaseExe, references: new[] { afterRetargeting.ToMetadataReference(), unmanagedCallersOnlyAssembly.ToMetadataReference() });
Symbols\Source\FileModifierTests.cs (8)
4277firstIsMetadataReference ? ref1.ToMetadataReference() : ref1.EmitToImageReference(), 4278secondIsMetadataReference ? ref2.ToMetadataReference() : ref2.EmitToImageReference() 4376var comp2 = CreateCompilation(source2, references: new[] { comp.ToMetadataReference() }, targetFramework: TargetFramework.Mscorlib461); 4419var referencingMetadataComp = CreateCompilation("", new[] { comp.ToMetadataReference() }); 4505var reference = useMetadataReference ? comp0.ToMetadataReference() : comp0.EmitToImageReference(); 4549var reference = comp0.ToMetadataReference(); 5110var comp2 = CreateCompilation(new[] { (source2, "File2.cs") }, references: new[] { useMetadataReference ? comp1.ToMetadataReference() : comp1.EmitToImageReference() }); 5116comp1 = CreateCompilation(new[] { (source1, "File1.cs") }, references: new[] { useMetadataReference ? comp2.ToMetadataReference() : comp2.EmitToImageReference() });
Symbols\Source\PropertyTests.cs (3)
2628var compRef = refComp.ToMetadataReference(embedInteropTypes: false); 2664compRef = refComp.ToMetadataReference(embedInteropTypes: true); 2721compRef = refComp.ToMetadataReference(embedInteropTypes: true);
Symbols\Source\RecordTests.cs (1)
1355emitReference ? comp.EmitToImageReference() : comp.ToMetadataReference()
Symbols\StaticAbstractMembersInInterfacesTests.cs (121)
6338references: new[] { compilation1.ToMetadataReference() }); 6470references: new[] { compilation1.ToMetadataReference() }); 6601references: new[] { compilation1.ToMetadataReference() }); 6719references: new[] { compilation1.ToMetadataReference() }); 6860references: new[] { compilation1.ToMetadataReference() }); 6989references: new[] { compilation1.ToMetadataReference() }); 8509references: new[] { compilation1.ToMetadataReference() }); 8594references: new[] { compilation1.ToMetadataReference() }); 9119references: new[] { compilation1.ToMetadataReference() }); 9187references: new[] { compilation1.ToMetadataReference() }); 9404references: new[] { compilation1.ToMetadataReference() }); 9457references: new[] { compilation1.ToMetadataReference() }); 9809references: new[] { compilation1.ToMetadataReference() }); 9871references: new[] { compilation1.ToMetadataReference() }); 12188references: new[] { compilation1.ToMetadataReference() }); 12251references: new[] { compilation1.ToMetadataReference() }); 12338references: new[] { compilation1.ToMetadataReference() }); 12388references: new[] { compilation1.ToMetadataReference() }); 12445references: new[] { compilation1.ToMetadataReference() }); 12558references: new[] { compilation1.ToMetadataReference() }); 12645references: new[] { compilation1.ToMetadataReference() }); 12745references: new[] { compilation1.ToMetadataReference() }); 13443references: new[] { compilation1.ToMetadataReference() }); 13495references: new[] { compilation1.ToMetadataReference() }); 13547references: new[] { compilation1.ToMetadataReference() }); 13602references: new[] { compilation1.ToMetadataReference() }); 13654references: new[] { compilation1.ToMetadataReference() }); 13706references: new[] { compilation1.ToMetadataReference() }); 14153references: new[] { compilation1.ToMetadataReference() }); 14202references: new[] { compilation1.ToMetadataReference() }); 14251references: new[] { compilation1.ToMetadataReference() }); 14303references: new[] { compilation1.ToMetadataReference() }); 14755references: new[] { compilation1.ToMetadataReference() }); 14804references: new[] { compilation1.ToMetadataReference() }); 15161references: new[] { compilation1.ToMetadataReference() }); 15210references: new[] { compilation1.ToMetadataReference() }); 15429references: new[] { compilation1.ToMetadataReference() }); 15478references: new[] { compilation1.ToMetadataReference() }); 15911references: new[] { compilation1.ToMetadataReference() }); 15967references: new[] { compilation1.ToMetadataReference() }); 16014references: new[] { compilation1.ToMetadataReference() }); 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() }) 16839references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 16851foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 16921references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 16933foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17003references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 17015foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17073references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 17086foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17148references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 17160foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17235references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 17247foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17325references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 17346foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 17431references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 17452foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 18778references: new[] { compilation1.ToMetadataReference() }); 18906references: new[] { compilation1.ToMetadataReference() }); 19066references: new[] { compilation1.ToMetadataReference() }); 19118references: new[] { compilation1.ToMetadataReference() }); 19170references: new[] { compilation1.ToMetadataReference() }); 19225references: new[] { compilation1.ToMetadataReference() }); 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() }) 21677references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 21689foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21786references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 21798foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 21888references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 21900foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 22755references: new[] { compilation1.ToMetadataReference() }); 22817references: new[] { compilation1.ToMetadataReference() }); 22873references: new[] { compilation1.ToMetadataReference() }); 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() }) 24999references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 25011foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 25069references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 25082foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 25533references: new[] { compilation1.ToMetadataReference() }); 25601references: new[] { compilation1.ToMetadataReference() }); 25654references: new[] { compilation1.ToMetadataReference() }); 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() }) 27665references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 27677foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 27735references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 27748foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 28425references: new[] { compilation1.ToMetadataReference() }); 28526references: new[] { compilation1.ToMetadataReference() }); 28578references: new[] { compilation1.ToMetadataReference() }); 28882foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 29507foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 29612references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 29624foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 29718references: new[] { CreateCompilation("", targetFramework: _supportingFramework).ToMetadataReference() }); 29730foreach (var reference in new[] { compilation1.ToMetadataReference(), compilation1.EmitToImageReference() }) 30523references: new[] { compilation1.ToMetadataReference() }); 30581references: new[] { compilation1.ToMetadataReference() }); 30638references: new[] { compilation1.ToMetadataReference() }); 30724references: new[] { compilation1.ToMetadataReference() }); 31774references: new[] { CreateEmptyCompilation("").ToMetadataReference() }); 31787references: new[] { compilation0.ToMetadataReference() }); 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() }) 33660var compilation2 = CreateCompilation(source2, options: TestOptions.DebugDll, references: new[] { compilation1.ToMetadataReference() }, 33717var compilation2 = CreateCompilation(source2, options: TestOptions.DebugDll, references: new[] { compilation1.ToMetadataReference() },
Symbols\SymbolErrorTests.cs (13)
20922references: new MetadataReference[] { forwarderCompilation.ToMetadataReference() }, 20987references: new MetadataReference[] { forwarderCompilation.ToMetadataReference() }, 21574var comp2 = CreateCompilation(source2, references: new[] { comp1_v1.ToMetadataReference() }); 21595var comp1_v2 = CreateCompilation(source1_2, assemblyName: "Lib1", references: new[] { comp2Ref, comp3.ToMetadataReference() }); 21622var comp1_v4 = CreateCompilation(source1_4, assemblyName: "Lib1", references: new[] { comp2Ref, comp3.ToMetadataReference() }); 21669var comp2 = CreateCompilation(source2, references: new[] { comp1_v1.ToMetadataReference() }); 21690var comp1_v2 = CreateCompilation(source1_2, assemblyName: "Lib1", references: new[] { comp2Ref, comp3.ToMetadataReference() }); 21717var comp1_v4 = CreateCompilation(source1_4, assemblyName: "Lib1", references: new[] { comp2Ref, comp3.ToMetadataReference() }); 21773var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }); 21846var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }); 21896var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() }); 21943var comp2 = CreateCompilation(new[] { string.Format(source2, "TypeForwarded_2"), string.Format(source2, "TypeForwardedTo"), source3 }, references: new[] { comp1.ToMetadataReference() }); 22004var comp2 = CreateCompilation(source2, references: new[] { comp1.ToMetadataReference() });
Symbols\TypeTests.cs (1)
743var refAsm = CreateCompilation(refSource, assemblyName: "RefAsm").ToMetadataReference();
Symbols\UnsignedRightShiftTests.cs (7)
1993var compilation2 = CreateCompilation(source1, options: TestOptions.DebugExe, references: new[] { compilation0.ToMetadataReference() }, 2245var compilation2 = CreateCompilation(source1, options: TestOptions.DebugExe, references: new[] { compilation0.ToMetadataReference() }, 2280var compilation2 = CreateCompilation(source1, options: TestOptions.DebugDll, references: new[] { compilation0.ToMetadataReference() }, 3443foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 3495foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 3547foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() }) 3599foreach (var reference in new[] { compilation0.ToMetadataReference(), compilation0.EmitToImageReference() })
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
840return compilation.ToMetadataReference();
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
431references: new[] { utilCompilation.ToMetadataReference() });
Microsoft.CodeAnalysis.UnitTests (4)
MetadataReferences\MetadataReferenceTests.cs (4)
341var r = c.ToMetadataReference(); 448r = CS.CSharpCompilation.Create("compilation name").ToMetadataReference(); 539var c1a = CS.CSharpCompilation.Create("goo").ToMetadataReference(); 541var c2 = CS.CSharpCompilation.Create("goo").ToMetadataReference();
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\CompilationAPITests.vb (2)
1054Dim csCompRef = csComp.ToMetadataReference(embedInteropTypes:=True) 1322Dim compRef = csComp.ToMetadataReference()