1809 references to GetTypeByMetadataName
ConfigurationSchemaGenerator (1)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
IdeCoreBenchmarks (2)
FindReferencesBenchmarks.cs (1)
98_type = compilation.GetTypeByMetadataName("Microsoft.CodeAnalysis.SyntaxToken");
RenameBenchmarks.cs (1)
49_symbol = compilation.GetTypeByMetadataName("Microsoft.CodeAnalysis.CSharp.BoundKind");
ILLink.RoslynAnalyzer (7)
CompilationExtensions.cs (1)
42 var type = compilation.GetTypeByMetadataName (fullyQualifiedMetadataName);
DataFlow\LocalDataFlowVisitor.cs (1)
175 var assemblyType = Compilation.GetTypeByMetadataName ("Microsoft.CSharp.RuntimeBinder.Binder");
RequiresAssemblyFilesAnalyzer.cs (3)
68 var runtimeFeaturesType = compilation.GetTypeByMetadataName ("ILLink.RoslynAnalyzer.TestFeatures"); 83 var assemblyType = compilation.GetTypeByMetadataName ("System.Reflection.Assembly"); 93 var assemblyNameType = compilation.GetTypeByMetadataName ("System.Reflection.AssemblyName");
RequiresDynamicCodeAnalyzer.cs (1)
128 var runtimeFeaturesType = compilation.GetTypeByMetadataName ("System.Runtime.CompilerServices.RuntimeFeature");
RequiresUnreferencedCodeAnalyzer.cs (1)
71 var runtimeFeaturesType = compilation.GetTypeByMetadataName ("ILLink.RoslynAnalyzer.TestFeatures");
Microsoft.Analyzers.Extra (33)
AsyncCallInsideUsingBlockAnalyzer.cs (4)
28var taskType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.Task"); 29var taskOfTType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.Task`1"); 30var valueTaskType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask"); 31var valueTaskOfTType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask`1");
AsyncMethodWithoutCancellation.cs (8)
28var taskType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.Task"); 29var taskOfTType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.Task`1"); 30var valueTaskType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask"); 31var valueTaskOfTType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); 42var cancellationTokenType = compilationContext.Compilation.GetTypeByMetadataName("System.Threading.CancellationToken"); 43var httpContextType = compilationContext.Compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Http.HttpContext"); 45compilationContext.Compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Connections.ConnectionContext"); 47compilationContext.Compilation.GetTypeByMetadataName("System.ObsoleteAttribute");
CallAnalysis\Arrays.cs (3)
83var freezer = reg.Compilation.GetTypeByMetadataName("System.Collections.Frozen.FrozenDictionary"); 92freezer = reg.Compilation.GetTypeByMetadataName("System.Collections.Frozen.FrozenSet"); 114var flagsAttr = context.Compilation.GetTypeByMetadataName("System.FlagsAttribute");
CallAnalysis\CallAnalyzer.Registrar.cs (5)
70var type = Compilation.GetTypeByMetadataName(pair.Key); 113var type = Compilation.GetTypeByMetadataName(typeName); 148var type = Compilation.GetTypeByMetadataName(pair.Key); 204var type = Compilation.GetTypeByMetadataName(pair.Key); 225var type = Compilation.GetTypeByMetadataName(et);
CallAnalysis\Fixers\LegacyLoggingFixer.cs (4)
42internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName1 = (c, n) => c.GetTypeByMetadataName(n); 43internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName2 = (c, n) => c.GetTypeByMetadataName(n); 44internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName3 = (c, n) => c.GetTypeByMetadataName(n); 595gen.MemberAccessExpression(gen.TypeExpression(comp.GetTypeByMetadataName("Microsoft.Extensions.Logging.LogLevel")!), details.Level),
CallAnalysis\LegacyLogging.cs (1)
18var loggerExtensions = reg.Compilation.GetTypeByMetadataName("Microsoft.Extensions.Logging.LoggerExtensions");
CallAnalysis\Split.cs (1)
17var memExt = reg.Compilation.GetTypeByMetadataName("System.MemoryExtensions");
CallAnalysis\StartsEndsWith.cs (1)
20var stringCompType = reg.Compilation.GetTypeByMetadataName("System.StringComparison");
CallAnalysis\ValueTuple.cs (1)
29var type = reg.Compilation.GetTypeByMetadataName("System.Tuple");
ConditionalAccessAnalyzer.cs (1)
30var maybeNull = compilationStartContext.Compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.MaybeNullAttribute");
MakeExeTypesInternalAnalyzer.cs (3)
62var type = compilationStartContext.Compilation.GetTypeByMetadataName(name); 72var type = compilationStartContext.Compilation.GetTypeByMetadataName(name); 82var type = compilationStartContext.Compilation.GetTypeByMetadataName(name);
Utilities\CompilationExtensions.cs (1)
12var type = compilation.GetTypeByMetadataName("System.Environment");
Microsoft.Analyzers.Local (9)
ApiLifecycle\ApiLifecycleAnalyzer.cs (2)
68var obsoleteAttribute = compilation.GetTypeByMetadataName(ObsoleteAttributeFullName); 150var obsoleteAttribute = context.Compilation.GetTypeByMetadataName(ObsoleteAttributeFullName);
CallAnalysis\CallAnalyzer.Registrar.cs (5)
70var type = Compilation.GetTypeByMetadataName(pair.Key); 113var type = Compilation.GetTypeByMetadataName(typeName); 148var type = Compilation.GetTypeByMetadataName(pair.Key); 204var type = Compilation.GetTypeByMetadataName(pair.Key); 225var type = Compilation.GetTypeByMetadataName(et);
CallAnalysis\ToInvariantString.cs (2)
26var formatProvider = reg.Compilation.GetTypeByMetadataName("System.IFormatProvider"); 46var cultureInfo = context.Compilation.GetTypeByMetadataName("System.Globalization.CultureInfo");
Microsoft.AspNetCore.Analyzers (3)
StartupSymbols.cs (3)
12IApplicationBuilder = compilation.GetTypeByMetadataName(SymbolNames.IApplicationBuilder.MetadataName); 13IServiceCollection = compilation.GetTypeByMetadataName(SymbolNames.IServiceCollection.MetadataName); 14MvcOptions = compilation.GetTypeByMetadataName(SymbolNames.MvcOptions.MetadataName);
Microsoft.AspNetCore.App.Analyzers (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
138=> SymbolEqualityComparer.Default.Equals(type, semanticModel.Compilation.GetTypeByMetadataName(typeName));
Microsoft.AspNetCore.Components.Analyzers (4)
ComponentSymbols.cs (4)
18var parameterAttribute = compilation.GetTypeByMetadataName(ComponentsApi.ParameterAttribute.MetadataName); 25var cascadingParameterAttribute = compilation.GetTypeByMetadataName(ComponentsApi.CascadingParameterAttribute.MetadataName); 32var icomponentType = compilation.GetTypeByMetadataName(ComponentsApi.IComponent.MetadataName); 39var dictionary = compilation.GetTypeByMetadataName("System.Collections.Generic.Dictionary`2");
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
ComponentSymbols.cs (4)
18var parameterAttribute = compilation.GetTypeByMetadataName(ComponentsApi.ParameterAttribute.MetadataName); 25var cascadingParameterAttribute = compilation.GetTypeByMetadataName(ComponentsApi.CascadingParameterAttribute.MetadataName); 32var icomponentType = compilation.GetTypeByMetadataName(ComponentsApi.IComponent.MetadataName); 39var dictionary = compilation.GetTypeByMetadataName("System.Collections.Generic.Dictionary`2");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
138=> SymbolEqualityComparer.Default.Equals(type, semanticModel.Compilation.GetTypeByMetadataName(typeName));
Microsoft.AspNetCore.Mvc.Analyzers (8)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (5)
147PageModelAttribute = compilation.GetTypeByMetadataName(SymbolNames.PageModelAttributeType); 148IFilterMetadata = compilation.GetTypeByMetadataName(SymbolNames.IFilterMetadataType); 149AuthorizeAttribute = compilation.GetTypeByMetadataName(SymbolNames.AuthorizeAttribute); 150AllowAnonymousAttribute = compilation.GetTypeByMetadataName(SymbolNames.AllowAnonymousAttribute); 151IRouteTemplateProvider = compilation.GetTypeByMetadataName(SymbolNames.IRouteTemplateProvider);
TagHelpersInCodeBlocksAnalyzer.cs (1)
174typeSymbol = compilation.GetTypeByMetadataName(typeName);
TopLevelParameterNameAnalyzer.cs (1)
300typeSymbol = compilation.GetTypeByMetadataName(typeName);
ViewFeaturesAnalyzerContext.cs (1)
26private INamedTypeSymbol GetType(string name) => Context.Compilation.GetTypeByMetadataName(name);
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
AddResponseTypeAttributeCodeFixAction.cs (1)
135var statusCodesType = semanticModel.Compilation.GetTypeByMetadataName(ApiSymbolNames.HttpStatusCodes);
ApiControllerSymbolCache.cs (2)
90var statusCodeActionResult = compilation.GetTypeByMetadataName(ApiSymbolNames.IStatusCodeActionResult); 128typeSymbol = compilation.GetTypeByMetadataName(typeName);
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
423_lazyGeneratedCodeAttribute = analyzerExecutor.Compilation?.GetTypeByMetadataName("System.CodeDom.Compiler.GeneratedCodeAttribute");
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (2)
233new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.SuppressMessageAttribute")), 249new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute")),
Microsoft.CodeAnalysis.CodeStyle (69)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
54var iCustomMarshaler = context.Compilation.GetTypeByMetadataName(typeof(ICustomMarshaler).FullName!);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
175=> semanticModel.Compilation.GetTypeByMetadataName(typeof(T).FullName!);
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
74enumerableType = compilation.GetTypeByMetadataName(typeof(Enumerable)?.FullName!);
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
109var nullableType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Nullable<>).FullName!);
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
73var formatProviderType = startContext.Compilation.GetTypeByMetadataName(typeof(System.IFormatProvider).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (63)
73=> compilation.GetTypeByMetadataName(typeof(Attribute).FullName!); 76=> compilation.GetTypeByMetadataName(typeof(Exception).FullName!); 79=> compilation.GetTypeByMetadataName(typeof(System.Diagnostics.DebuggerDisplayAttribute).FullName!); 82=> compilation.GetTypeByMetadataName(typeof(System.Runtime.InteropServices.StructLayoutAttribute).FullName!); 85=> compilation.GetTypeByMetadataName("System.ComponentModel.DesignerCategoryAttribute"); 88=> compilation.GetTypeByMetadataName("Microsoft.VisualBasic.CompilerServices.DesignerGeneratedAttribute"); 91=> compilation.GetTypeByMetadataName("Microsoft.VisualBasic.HideModuleNameAttribute"); 94=> compilation.GetTypeByMetadataName(typeof(ThreadStaticAttribute).FullName!); 97=> compilation.GetTypeByMetadataName(typeof(EventArgs).FullName!); 100=> compilation.GetTypeByMetadataName(typeof(NotImplementedException).FullName!); 103=> compilation.GetTypeByMetadataName(typeof(EqualityComparer<>).FullName!); 106=> compilation.GetTypeByMetadataName(typeof(Action).FullName!); 109=> compilation.GetTypeByMetadataName("System.Linq.Expressions.Expression`1"); 112=> compilation.GetTypeByMetadataName(typeof(EditorBrowsableAttribute).FullName!); 115=> compilation.GetTypeByMetadataName(typeof(EditorBrowsableState).FullName!); 118=> compilation.GetTypeByMetadataName(typeof(Task).FullName!); 121=> compilation.GetTypeByMetadataName(typeof(Task<>).FullName!); 124=> compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask"); 127=> compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); 130=> compilation.GetTypeByMetadataName(typeof(System.Collections.IEnumerable).FullName!); 133=> compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!); 136=> compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName!); 139=> compilation.GetTypeByMetadataName(typeof(IList<>).FullName!); 142=> compilation.GetTypeByMetadataName(typeof(IReadOnlyList<>).FullName!); 145=> compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerable`1"); 148=> compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerator`1"); 151=> compilation.GetTypeByMetadataName(typeof(ImmutableArray<>).FullName!); 154=> compilation.GetTypeByMetadataName(typeof(SerializableAttribute).FullName!); 157=> compilation.GetTypeByMetadataName(typeof(CoClassAttribute).FullName!); 160=> compilation.GetTypeByMetadataName(typeof(ComAliasNameAttribute).FullName!); 163=> compilation.GetTypeByMetadataName(typeof(SuppressMessageAttribute).FullName!); 166=> compilation.GetTypeByMetadataName(typeof(TupleElementNamesAttribute).FullName!); 169=> compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.NativeIntegerAttribute"); 172=> compilation.GetTypeByMetadataName(typeof(DynamicAttribute).FullName!); 175=> compilation.GetTypeByMetadataName(typeof(Lazy<>).FullName!); 178=> compilation.GetTypeByMetadataName(typeof(ISerializable).FullName!); 181=> compilation.GetTypeByMetadataName(typeof(SerializationInfo).FullName!); 184=> compilation.GetTypeByMetadataName(typeof(StreamingContext).FullName!); 187=> compilation.GetTypeByMetadataName(typeof(OnDeserializingAttribute).FullName!); 190=> compilation.GetTypeByMetadataName(typeof(OnDeserializedAttribute).FullName!); 193=> compilation.GetTypeByMetadataName(typeof(OnSerializingAttribute).FullName!); 196=> compilation.GetTypeByMetadataName(typeof(OnSerializedAttribute).FullName!); 199=> compilation.GetTypeByMetadataName(typeof(ComRegisterFunctionAttribute).FullName!); 202=> compilation.GetTypeByMetadataName(typeof(ComUnregisterFunctionAttribute).FullName!); 205=> compilation.GetTypeByMetadataName(typeof(ConditionalAttribute).FullName!); 208=> compilation.GetTypeByMetadataName(typeof(ObsoleteAttribute).FullName!); 211=> compilation.GetTypeByMetadataName("System.Composition.ImportingConstructorAttribute"); 214=> compilation.GetTypeByMetadataName("System.ComponentModel.Composition.ImportingConstructorAttribute"); 217=> compilation.GetTypeByMetadataName(typeof(IDisposable).FullName!); 220=> compilation.GetTypeByMetadataName(typeof(NotNullAttribute).FullName!); 223=> compilation.GetTypeByMetadataName(typeof(MaybeNullAttribute).FullName!); 226=> compilation.GetTypeByMetadataName(typeof(MaybeNullWhenAttribute).FullName!); 229=> compilation.GetTypeByMetadataName(typeof(AllowNullAttribute).FullName!); 232=> compilation.GetTypeByMetadataName(typeof(DisallowNullAttribute).FullName!); 235=> compilation.GetTypeByMetadataName(typeof(DataMemberAttribute).FullName!); 238=> compilation.GetTypeByMetadataName(typeof(DataContractAttribute).FullName!); 241=> compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AsyncMethodBuilderAttribute"); 244=> compilation.GetTypeByMetadataName(typeof(CancellationToken).FullName!); 247=> compilation.GetTypeByMetadataName($"System.ValueTuple`{arity}"); 250=> compilation.GetTypeByMetadataName(typeof(List<>).FullName!); 253=> compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName!); 256=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!); 259=> compilation.GetTypeByMetadataName(typeof(InterpolatedStringHandlerAttribute).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
441var delegateType = compilation.GetTypeByMetadataName(method.ReturnsVoid
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
61var attribute = compilation.GetTypeByMetadataName(typeof(ObsoleteAttribute).FullName!);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
206var gcType = compilation.GetTypeByMetadataName(typeof(GC).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
421var type = compilation.GetTypeByMetadataName(typeof(ArgumentNullException).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
223var iequatableType = compilation.GetTypeByMetadataName(typeof(IEquatable<>).FullName);
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
55var expressionType = compilation.GetTypeByMetadataName(typeof(Expression<>).FullName!);
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
64var expressionType = compilation.GetTypeByMetadataName(typeof(Expression<>).FullName!);
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
55var expressionType = context.Compilation.GetTypeByMetadataName(typeof(System.Linq.Expressions.Expression<>).FullName!);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (11)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (6)
118var ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName!); 119var ienumeratorSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator).FullName!); 120var ienumerableGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!); 121var ienumeratorGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName!); 191var ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName!); 192var ienumeratorSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator).FullName!);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
116ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName!); 117ienumerableGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!);
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
92else if (type.Equals(semanticModel.Compilation.GetTypeByMetadataName(typeof(CancellationToken).FullName!))) 123var flagsAttribute = compilation.GetTypeByMetadataName(typeof(FlagsAttribute).FullName!);
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
101var taskType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Task).FullName!);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyTests.cs (1)
168var type = compilation.GetTypeByMetadataName("ConditionalWeakTableTest`2");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (79)
CodeGen\CodeGenDeconstructTests.cs (1)
259var firstDeconstructMethod = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C").GetMembers(WellKnownMemberNames.DeconstructMethodName)
CodeGen\CodeGenFunctionPointersTests.cs (15)
295var c = comp.GetTypeByMetadataName("C"); 371var c = comp.GetTypeByMetadataName("C"); 562var c = ((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("C"); 684var testClass = compilation.GetTypeByMetadataName("Test1")!; 984var c = comp.GetTypeByMetadataName("C"); 5398verifySymbolNullabilities(comp.GetTypeByMetadataName("C")!); 5704var a = comp.GetTypeByMetadataName("A"); 7670var testMod = CSharpCustomModifier.CreateOptional(comp1.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvTest`1")); 7755var testMod = CSharpCustomModifier.CreateOptional(comp2.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvTest")); 8064var c = comp.GetTypeByMetadataName("C"); 8740var c = comp.GetTypeByMetadataName("C"); 10338var c = compilation.GetTypeByMetadataName("C"); 10406var c = compilation.GetTypeByMetadataName("C"); 10516var c = comp.GetTypeByMetadataName("C"); 10518var callConvCdecl = comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvCdecl");
CodeGen\CodeGenLocalFunctionTests.cs (9)
2595Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), goo.ContainingType); 2611var program = verify.Compilation.GetTypeByMetadataName("Program"); 3133var program = verify.Compilation.GetTypeByMetadataName("Program"); 3204var program = verify.Compilation.GetTypeByMetadataName("Program"); 3250var program = verify.Compilation.GetTypeByMetadataName("Program"); 3276var program = verify.Compilation.GetTypeByMetadataName("Program"); 3309var program = verify.Compilation.GetTypeByMetadataName("Program"); 3397var program = verify.Compilation.GetTypeByMetadataName("Program"); 4241Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), goo.ContainingType);
CodeGen\CodeGenReadonlyStructTests.cs (11)
827NamedTypeSymbol namedType = comp.GetTypeByMetadataName("Program+S1"); 844namedType = comp.GetTypeByMetadataName("Program+S1`1"); 865namedType = comp.GetTypeByMetadataName("Program+S2"); 872namedType = comp.GetTypeByMetadataName("Program+C1"); 879namedType = comp.GetTypeByMetadataName("Program+D1"); 910NamedTypeSymbol s1 = clientComp.GetTypeByMetadataName("Program+S1"); 1001NamedTypeSymbol namedType = comp.GetTypeByMetadataName("Program+S1"); 1008namedType = comp.GetTypeByMetadataName("Program+S1`1"); 1029namedType = comp.GetTypeByMetadataName("Program+S2"); 1036namedType = comp.GetTypeByMetadataName("Program+C1"); 1043namedType = comp.GetTypeByMetadataName("Program+D1");
CodeGen\CodeGenTupleTest.cs (38)
3345var c = comp.GetTypeByMetadataName("C"); 4475var vt2 = comp.GetTypeByMetadataName("System.ValueTuple`2"); 11025var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 11346var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 11738var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 11886var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 12170var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 12460var c = comp.GetTypeByMetadataName("C"); 12539var c = comp.GetTypeByMetadataName("C"); 12932var c = comp.GetTypeByMetadataName("C"); 13014var c = comp.GetTypeByMetadataName("C"); 13135var c = comp.GetTypeByMetadataName("C"); 13298var valuetuple = comp.GetTypeByMetadataName("System.ValueTuple`2"); 13345var valuetuple = comp.GetTypeByMetadataName("System.ValueTuple`2"); 13377var valuetuple = comp.GetTypeByMetadataName("System.ValueTuple`2"); 13526var c = comp.GetTypeByMetadataName("C"); 13584var c = comp.GetTypeByMetadataName("C"); 13933var test = comp.GetTypeByMetadataName("Test"); 14097var test = comp.GetTypeByMetadataName("Test"); 14229var test = comp.Compilation.GetTypeByMetadataName("Test`1"); 14423var test = comp.GetTypeByMetadataName("Test`1"); 15787var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 16014var c = ((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("C"); 20450var c1 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C1"); 20462var c2 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C2"); 20474var c3 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C3"); 20485var c4 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C4"); 20666var c1 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C1`1"); 20678var c2 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C2`1"); 20690var c3 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C3`1"); 20701var c4 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C4`1"); 20750var c3 = (INamedTypeSymbol)comp.GetTypeByMetadataName("C3`2"); 20799var c3 = comp.GetTypeByMetadataName("C3"); 20814c3.FindImplementationForInterfaceMember(comp.GetTypeByMetadataName("C4").InterfacesNoUseSiteDiagnostics()[0].GetMember("M")).ToTestDisplayString()); 23448var m = (MethodSymbol)(((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 23504var m = (IMethodSymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 23850var m = (MethodSymbol)(comp.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 23903var m = (PropertySymbol)(((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First());
Emit\EmitMetadataTests.cs (1)
2812var parentParameters = comp.GetTypeByMetadataName("Parent").GetMethod("M").GetParameters();
Emit\InAttributeModifierTests.cs (4)
3833var interfaceMethod = comp.GetTypeByMetadataName("ITest").GetMethod("M"); 3838var classMethod = comp.GetTypeByMetadataName("Test").GetMethod("M"); 3862var parentMethod = comp.GetTypeByMetadataName("ParentTest").GetMethod("M"); 3867var classMethod = comp.GetTypeByMetadataName("Test").GetMethod("M");
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\NumericIntPtrTests.cs (4)
9331var type = comp.GetTypeByMetadataName("I"); 9337type = comp.GetTypeByMetadataName("C"); 9365var type = comp.GetTypeByMetadataName("A"); 9371type = comp.GetTypeByMetadataName("B");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (182)
Attributes\AttributeTests.cs (2)
4898var goo = compilation.GetTypeByMetadataName("Goo"); 8854var type = compilation.GetTypeByMetadataName("Library1.Goo");
Attributes\AttributeTests_Assembly.cs (6)
1079Assert.NotNull(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHere")); 1080Assert.NotNull(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHereM")); 1180Assert.Null(netmoduleCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHere")); 1181Assert.Null(netmoduleCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHereM")); 1200Assert.Null(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHere")); 1201Assert.Null(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHereM"));
Attributes\AttributeTests_CallerInfoAttributes.cs (5)
1943var namedType = compilation.GetTypeByMetadataName("Program").GetPublicSymbol(); 1975var namedType = compilation.GetTypeByMetadataName("Program").GetPublicSymbol(); 2007var namedType = compilation.GetTypeByMetadataName("Program").GetPublicSymbol(); 2040var namedType = compilation.GetTypeByMetadataName("Program").GetPublicSymbol(); 2299var arguments = compilation.GetTypeByMetadataName("Program").GetAttributes().Single().CommonConstructorArguments;
Attributes\AttributeTests_Embedded.cs (4)
502Assert.NotNull(compilation1.GetTypeByMetadataName("TestReference1")); 503Assert.NotNull(compilation1.GetTypeByMetadataName("TestReference2")); 507Assert.Null(compilation2.GetTypeByMetadataName("TestReference1")); 508Assert.NotNull(compilation2.GetTypeByMetadataName("TestReference2"));
Attributes\AttributeTests_NativeInteger.cs (6)
278var type = comp.GetTypeByMetadataName("B"); 352var type = comp.GetTypeByMetadataName("B"); 435var type = comp.GetTypeByMetadataName("B"); 512var type = comp.GetTypeByMetadataName("B"); 630var type = comp.GetTypeByMetadataName("B"); 738var type = comp.GetTypeByMetadataName("B");
Attributes\AttributeTests_Synthesized.cs (1)
648var c1OfInt = comp.GetTypeByMetadataName("C1`1").Construct(comp.GetSpecialType(SpecialType.System_Int32));
Attributes\AttributeTests_WellKnownAttributes.cs (14)
4898NamedTypeSymbol typeC = comp.GetTypeByMetadataName("C"); 4904NamedTypeSymbol typeBobAttribute = comp.GetTypeByMetadataName("BobAttribute"); 4972var substitutedNested = comp.GetTypeByMetadataName("SubstitutedNested").BaseType(); 4976var substitutedNestedS = comp.GetTypeByMetadataName("SubstitutedNestedS").BaseType(); 4980var valueTupleS = comp.GetTypeByMetadataName("ValueTupleS").GetMember("M").GetTypeOrReturnType().Type; 4984var constructed = comp.GetTypeByMetadataName("Constructed").BaseType(); 4988var constructedS = comp.GetTypeByMetadataName("ConstructedS").BaseType(); 4992var extendedError = comp2.GetTypeByMetadataName("ExtendedError").BaseType(); 4996var topLevel = comp2.GetTypeByMetadataName("MissingTopLevel").BaseType(); 5000var nested = comp2.GetTypeByMetadataName("MissingNested").BaseType(); 5004var constructedError = comp2.GetTypeByMetadataName("MissingConstructed").BaseType(); 5008var nestedSubstitutedError = comp2.GetTypeByMetadataName("MissingSubstitutedNested`2").BaseType().ConstructedFrom; 5012var unbound = comp2.GetTypeByMetadataName("Unbound").BaseType().TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type; 5017var scriptClass = script.GetTypeByMetadataName("Script");
OverloadResolutionPriorityTests.cs (6)
692var c = comp3.GetTypeByMetadataName("C")!; 752var c = comp3.GetTypeByMetadataName("C")!; 800var derived = comp3.GetTypeByMetadataName("Derived")!; 903var c = ((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("C"); 985var attr = ((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute"); 1475var c = comp.GetTypeByMetadataName("C")!;
Semantics\ExperimentalAttributeTests.cs (32)
86Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 105Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 147Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 148Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 171Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 172Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 213Assert.Equal(ObsoleteAttributeKind.Obsolete, comp.GetTypeByMetadataName("C").ObsoleteKind); 214Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 215Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 252Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 281Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 318Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 319Assert.Equal(ObsoleteAttributeKind.Obsolete, comp.GetTypeByMetadataName("C").ObsoleteKind); 348Assert.Equal(ObsoleteAttributeKind.Obsolete, comp.GetTypeByMetadataName("C").ObsoleteKind); 404Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 405Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 428Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 429Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 471Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 472Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 498Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 499Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 560Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("C").ContainingModule.ObsoleteKind); 561Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("C").ContainingAssembly.ObsoleteKind); 563Assert.Equal(ObsoleteAttributeKind.None, comp.GetTypeByMetadataName("D").ContainingModule.ObsoleteKind); 564Assert.Equal(ObsoleteAttributeKind.Experimental, comp.GetTypeByMetadataName("D").ContainingAssembly.ObsoleteKind); 591var c = comp.GetTypeByMetadataName("C"); 632var c = comp.GetTypeByMetadataName("C"); 946var derived = comp.GetTypeByMetadataName("Derived"); 974var derived = comp.GetTypeByMetadataName("Derived"); 1011var derived = comp.GetTypeByMetadataName("Derived"); 1039var derived = comp.GetTypeByMetadataName("Derived");
Semantics\ParamsCollectionTests.cs (7)
239var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 355var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 538var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 683var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 1427var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2551var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2687var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single();
Semantics\PrimaryConstructorTests.cs (98)
127var members = comp.GetTypeByMetadataName("Point").GetMembers(); 3102Assert.Empty(comp.GetTypeByMetadataName("Test1").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes()); 3103Assert.Equal(2, comp.GetTypeByMetadataName("Test2").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes().Count()); 3145Assert.Empty(comp.GetTypeByMetadataName("Test1").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes()); 3146Assert.Equal(1, comp.GetTypeByMetadataName("Test2").InstanceConstructors.Where(c => !c.IsDefaultValueTypeConstructor()).Single().Parameters[0].GetAttributes().Count()); 3220var c = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C"); 3248var c = comp.GetTypeByMetadataName("C"); 3280var i = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("I"); 3322var e = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("E"); 3354var c = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C"); 3378var c = comp.GetTypeByMetadataName("C"); 3399var c = comp.GetTypeByMetadataName("C"); 3441var c1 = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C1"); 3447var c2 = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C2"); 3503var c1 = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C1"); 3509var c2 = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C2"); 3535var c = (SourceNamedTypeSymbol)comp.GetTypeByMetadataName("C"); 3557var c = (SourceMemberContainerTypeSymbol)comp.GetTypeByMetadataName("C"); 3583var c1 = (SourceMemberContainerTypeSymbol)comp.GetTypeByMetadataName("C1"); 3606var c1 = (SourceMemberContainerTypeSymbol)comp.GetTypeByMetadataName("C1"); 3628var c = (SourceMemberContainerTypeSymbol)comp.GetTypeByMetadataName("C"); 3650var c = (SourceMemberContainerTypeSymbol)comp.GetTypeByMetadataName("C"); 7837var capturedParameters = comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters(); 8702Assert.Empty(((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9885Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9945Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 9946Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9998Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9999Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10000Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10001Assert.Equal(2, comp.GetTypeByMetadataName("C4").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10020Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10047Assert.Equal(2, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10149Assert.Equal(1, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10192Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10227Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10270Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10308Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10339Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10379Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10415Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10451Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10490Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10529Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10565Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10601Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10640Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10679Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10718Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10754Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10790Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10830Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10877Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10921Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10961Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11004Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11051Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11093Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11138Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11173Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11203Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11238Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11268Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11303Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11334Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11370Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11401Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11444Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11483Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11522Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11562Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11605Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11795Assert.Equal(isStatic, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().IsEmpty()); 11839Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11840Assert.Empty(comp.GetTypeByMetadataName("S2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11841Assert.NotEmpty(comp.GetTypeByMetadataName("S3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11913Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11949Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11992Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12040Assert.Equal("System.String P1", comp1.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12041Assert.Equal("System.Int32 p2", comp1.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12042Assert.Equal(2, comp1.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 12072Assert.Empty(comp2.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12073Assert.Empty(comp2.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12113Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12157Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12203Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 14619Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 14815Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15016Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15242Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15553Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 16378Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 19702Assert.Equal("p1", comp.GetTypeByMetadataName("C1").Indexers.Single().MetadataName); 19732Assert.Equal("p1", comp.GetTypeByMetadataName("C1").Indexers.Single().MetadataName); 19753Assert.Equal("p1", comp.GetTypeByMetadataName("C1").Indexers.Single().MetadataName); 19754Assert.Single(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20209Assert.Empty(comp.GetTypeByMetadataName("C").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters());
Semantics\RecordTests.cs (1)
9980var b1Ctor = comp.GetTypeByMetadataName("B1")!.GetMembersUnordered().OfType<SynthesizedPrimaryConstructor>().Single();
Microsoft.CodeAnalysis.CSharp.Features (16)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
372=> Equals(typeSymbol.OriginalDefinition, _semanticModel.Compilation.GetTypeByMetadataName(typeof(List<>).FullName));
ConvertToInterpolatedString\CSharpConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
25=> compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler") != null;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
55var expressionType = compilation.GetTypeByMetadataName(typeof(Expression<>).FullName!);
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
64var expressionType = compilation.GetTypeByMetadataName(typeof(Expression<>).FullName!);
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
55var expressionType = context.Compilation.GetTypeByMetadataName(typeof(System.Linq.Expressions.Expression<>).FullName!);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (6)
118var ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName!); 119var ienumeratorSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator).FullName!); 120var ienumerableGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!); 121var ienumeratorGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName!); 191var ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName!); 192var ienumeratorSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerator).FullName!);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
116ienumerableSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName!); 117ienumerableGenericSymbol = model.Compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!);
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
92else if (type.Equals(semanticModel.Compilation.GetTypeByMetadataName(typeof(CancellationToken).FullName!))) 123var flagsAttribute = compilation.GetTypeByMetadataName(typeof(FlagsAttribute).FullName!);
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
101var taskType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Task).FullName!);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (1)
84var typeSymbol = compilation.GetTypeByMetadataName("C");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (302)
Semantics\FunctionPointerTests.cs (4)
1945var declaredSymbol = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMethod("M2").ISymbol; 2006var derived = comp.GetTypeByMetadataName("Derived"); 2123var d = comp.GetTypeByMetadataName("D"); 3936var m = comp.GetTypeByMetadataName("C").GetMethod("M");
Semantics\InitOnlyMemberTests.cs (8)
4259var s = verifier.Compilation.GetTypeByMetadataName("S"); 4298var s = verifier.Compilation.GetTypeByMetadataName("S"); 4338var s = verifier.Compilation.GetTypeByMetadataName("S"); 4380var s = ((Compilation)comp).GetTypeByMetadataName("S"); 4403var s = ((Compilation)comp).GetTypeByMetadataName("S"); 4434var s = verifier.Compilation.GetTypeByMetadataName("S"); 4764Assert.Equal("corlibWithIsExternalInit", comp.GetTypeByMetadataName("System.Runtime.CompilerServices.IsExternalInit").ContainingAssembly.Name); 4773Assert.Equal(expectedAssemblyName, comp.GetTypeByMetadataName("System.Runtime.CompilerServices.IsExternalInit").ContainingAssembly.Name);
Semantics\InterpolationTests.cs (26)
6849var sParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 6881var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 6953var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 6956var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 7028var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7031var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 7106var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7109var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 7181var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7184var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 7289var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7292var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 7329var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7332var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 7369var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7372var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 7409var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7412var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 7486var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7489var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 7563var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7566var cParam = comp.GetTypeByMetadataName("C").GetMethod(".ctor").Parameters.Single(); 7644var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7647var cParam = comp.GetTypeByMetadataName("C`1").GetMethod("M").Parameters.Single(); 7806var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 7809var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.First();
Semantics\LambdaTests.cs (2)
3904var expectedAttributes = expectedAttributeNames.Select(n => comp.GetTypeByMetadataName(n)); 3946var expectedAttributeConstructor = comp.GetTypeByMetadataName(expectedAttributeName).InstanceConstructors.Single().GetPublicSymbol();
Semantics\LocalFunctionTests.cs (10)
556var aAttribute = comp.GetTypeByMetadataName("A"); 820var aAttribute = comp.GetTypeByMetadataName("A"); 858Assert.Equal(comp.GetTypeByMetadataName("A"), attr.AttributeClass.GetSymbol()); 976Assert.Equal(comp.GetTypeByMetadataName("PropAttribute"), attributes[0].AttributeClass.GetSymbol()); 977Assert.Equal(comp.GetTypeByMetadataName("ReturnAttribute"), attributes[1].AttributeClass.GetSymbol()); 978Assert.Equal(comp.GetTypeByMetadataName("MethodAttribute"), attributes[2].AttributeClass.GetSymbol()); 982Assert.Equal(comp.GetTypeByMetadataName("PropAttribute"), returnAttributes[0].AttributeClass.GetSymbol()); 983Assert.Equal(comp.GetTypeByMetadataName("ReturnAttribute"), returnAttributes[1].AttributeClass.GetSymbol()); 984Assert.Equal(comp.GetTypeByMetadataName("MethodAttribute"), returnAttributes[2].AttributeClass.GetSymbol()); 1025var attributeConstructor = comp.GetTypeByMetadataName("A").InstanceConstructors.Single();
Semantics\LockTests.cs (3)
510var symbol = compilation.GetTypeByMetadataName("Test"); 529var symbol = compilation.GetTypeByMetadataName("Test"); 648var symbol = compilation.GetTypeByMetadataName("System.Type");
Semantics\MultiDimensionalArrayTests.cs (3)
534var m2 = compilation.GetTypeByMetadataName("Test").GetMember<MethodSymbol>("M2"); 1092var test = compilation.GetTypeByMetadataName("Test"); 1680var p = compilation.GetTypeByMetadataName("Program");
Semantics\NativeIntegerTests.cs (12)
106var type = comp.GetTypeByMetadataName("System.IntPtr"); 110type = comp.GetTypeByMetadataName("System.UIntPtr"); 202var type = comp.GetTypeByMetadataName("System.IntPtr"); 206type = comp.GetTypeByMetadataName("System.UIntPtr"); 13572var type = comp.GetTypeByMetadataName("I"); 13578type = comp.GetTypeByMetadataName("C"); 13608var type = comp.GetTypeByMetadataName("A"); 13614type = comp.GetTypeByMetadataName("B"); 13667var type = comp.GetTypeByMetadataName("A"); 13673type = comp.GetTypeByMetadataName("B"); 13730var type = comp.GetTypeByMetadataName("A"); 13736type = comp.GetTypeByMetadataName("B");
Semantics\NullableReferenceTypesTests.cs (151)
6467var c = comp.GetTypeByMetadataName("C"); 6489var c = comp.GetTypeByMetadataName("C"); 11453var b = compilation.GetTypeByMetadataName("B"); 11504var b = compilation.GetTypeByMetadataName("B"); 11567var b = compilation.GetTypeByMetadataName("B"); 11626var b = compilation.GetTypeByMetadataName("B"); 11631var d = compilation.GetTypeByMetadataName("D"); 11698var b = compilation.GetTypeByMetadataName("B"); 11731var b = compilation.GetTypeByMetadataName("B"); 11766var b = compilation.GetTypeByMetadataName("B"); 11847var b = compilation.GetTypeByMetadataName("B"); 11891var b = compilation.GetTypeByMetadataName("B"); 11929var b = compilation.GetTypeByMetadataName("B"); 12014var b = compilation.GetTypeByMetadataName("B"); 12097var b = compilation.GetTypeByMetadataName("B"); 12185var b = compilation.GetTypeByMetadataName("B"); 12257var b = compilation.GetTypeByMetadataName("B"); 12329var type = compilation.GetTypeByMetadataName(typeName); 12343var type = compilation.GetTypeByMetadataName(typeName); 12411var b1 = compilation.GetTypeByMetadataName("B1"); 12418var b2 = compilation.GetTypeByMetadataName("B2"); 12684var ia = compilation.GetTypeByMetadataName("IA"); 12692var type = compilation.GetTypeByMetadataName(typeName); 12703var type = compilation.GetTypeByMetadataName(typeName); 12711var type = compilation.GetTypeByMetadataName(typeName); 12780var ia = compilation.GetTypeByMetadataName("IA"); 12781var b1 = compilation.GetTypeByMetadataName("B1"); 12799var type = compilation.GetTypeByMetadataName(typeName); 12883foreach (var member in compilation.GetTypeByMetadataName("B1").GetMembers().OfType<PropertySymbol>()) 12888foreach (var member in compilation.GetTypeByMetadataName("B2").GetMembers().OfType<PropertySymbol>()) 12895var type = compilation.GetTypeByMetadataName(typeName); 13031var b = compilation.GetTypeByMetadataName("B"); 13033foreach (var member in compilation.GetTypeByMetadataName("IA").GetMembers().OfType<PropertySymbol>()) 13039foreach (var member in compilation.GetTypeByMetadataName("IA2").GetMembers().OfType<PropertySymbol>()) 13047var type = compilation.GetTypeByMetadataName(typeName); 13122var b = compilation.GetTypeByMetadataName("B"); 13124foreach (var member in compilation.GetTypeByMetadataName("IA").GetMembers().OfType<PropertySymbol>()) 13130foreach (var member in compilation.GetTypeByMetadataName("IA2").GetMembers().OfType<PropertySymbol>()) 13138var type = compilation.GetTypeByMetadataName(typeName); 13203var b = compilation.GetTypeByMetadataName("B"); 13319var ia = compilation.GetTypeByMetadataName("IA"); 13320var b = compilation.GetTypeByMetadataName("B"); 13408var ia = compilation.GetTypeByMetadataName("IA"); 13409var b = compilation.GetTypeByMetadataName("B"); 13685var b = compilation.GetTypeByMetadataName("B"); 13853var m1 = compilation.GetTypeByMetadataName("B").GetMember<MethodSymbol>("M1"); 13896var b = compilation.GetTypeByMetadataName("B"); 13965var b = compilation.GetTypeByMetadataName("B"); 14024var b = compilation.GetTypeByMetadataName("B"); 14131var b = compilation.GetTypeByMetadataName("B"); 14227var b = compilation.GetTypeByMetadataName("B"); 14232var d = compilation.GetTypeByMetadataName("D"); 14283var b = compilation.GetTypeByMetadataName("B"); 14288var d = compilation.GetTypeByMetadataName("D"); 16496var ia = compilation.GetTypeByMetadataName("IA"); 16497var b = compilation.GetTypeByMetadataName("B"); 16633foreach (var member in compilation.GetTypeByMetadataName(typeName).GetMembers().OfType<PropertySymbol>()) 16639foreach (var member in compilation.GetTypeByMetadataName("B3").GetMembers().OfType<PropertySymbol>()) 16646var type = compilation.GetTypeByMetadataName(typeName); 16718var implemented = compilation.GetTypeByMetadataName(typeName[0]).GetMembers().OfType<PropertySymbol>().Single(); 16719var implementing = (PropertySymbol)compilation.GetTypeByMetadataName(typeName[1]).FindImplementationForInterfaceMember(implemented); 16724var implemented = compilation.GetTypeByMetadataName("IA3").GetMembers().OfType<PropertySymbol>().Single(); 16725var implementing = (PropertySymbol)compilation.GetTypeByMetadataName("B3").FindImplementationForInterfaceMember(implemented); 16731var type = compilation.GetTypeByMetadataName(typeName); 16803var implemented = compilation.GetTypeByMetadataName(typeName[0]).GetMembers().OfType<PropertySymbol>().Single(); 16804var implementing = (PropertySymbol)compilation.GetTypeByMetadataName(typeName[1]).FindImplementationForInterfaceMember(implemented); 16809var implemented = compilation.GetTypeByMetadataName("IA3").GetMembers().OfType<PropertySymbol>().Single(); 16810var implementing = (PropertySymbol)compilation.GetTypeByMetadataName("B3").FindImplementationForInterfaceMember(implemented); 16816var type = compilation.GetTypeByMetadataName(typeName); 16903var c1 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C1"); 16915var c2 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C2"); 16927var c3 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C3"); 16938var c4 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C4"); 17269var c1 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C1`1"); 17281var c2 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C2`1"); 17293var c3 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C3`1"); 17304var c4 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C4`1"); 17352var c3 = (NamedTypeSymbol)comp.GetTypeByMetadataName("C3`2"); 17726var ia = compilation.GetTypeByMetadataName("IA"); 17727var b = compilation.GetTypeByMetadataName("B"); 17794var ia = compilation.GetTypeByMetadataName("IA"); 17795var b = compilation.GetTypeByMetadataName("B"); 17835var c = compilation.GetTypeByMetadataName("C"); 17874var c1 = compilation.GetTypeByMetadataName("C1"); 17889c1 = compilation.GetTypeByMetadataName("C1"); 76966var b = compilation.GetTypeByMetadataName("B"); 76977Assert.Equal("String? D1()", compilation.GetTypeByMetadataName("D1") 76981Assert.Equal("String D1()", compilation.GetTypeByMetadataName("D1") 76985Assert.Equal("String! D2()", compilation.GetTypeByMetadataName("D2") 76989var f = compilation.GetTypeByMetadataName("F"); 77050Assert.Equal("String? D1()", compilation.GetTypeByMetadataName("D1") 111007var c = comp.GetTypeByMetadataName("C`2"); 112806var b = comp.GetTypeByMetadataName("A`2+B"); 112891var b = comp.GetTypeByMetadataName("A`2+B"); 112910var b = comp.GetTypeByMetadataName("A`1+B"); 112930var b = comp.GetTypeByMetadataName("A`1+B"); 113007var b = comp.GetTypeByMetadataName("A`2+B"); 113087var b = comp.GetTypeByMetadataName("A`2+B"); 113108var a = comp.GetTypeByMetadataName("A"); 113649var a = comp.GetTypeByMetadataName("A`1"); 113668var a = comp.GetTypeByMetadataName("A`1"); 113692var a = comp.GetTypeByMetadataName("A`1"); 113714var a = comp.GetTypeByMetadataName("A`1"); 113747var a = comp.GetTypeByMetadataName("A`1"); 113768var a = comp.GetTypeByMetadataName("A`1"); 116619Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind); 116620Assert.Equal(TypeKind.Enum, compilation1.GetTypeByMetadataName("B").TypeKind); 116621Assert.Equal(TypeKind.Class, compilation1.GetTypeByMetadataName("C").TypeKind); 116622Assert.Equal(TypeKind.Delegate, compilation1.GetTypeByMetadataName("D").TypeKind); 116623Assert.Equal(TypeKind.Interface, compilation1.GetTypeByMetadataName("I1").TypeKind); 116639Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind); 116640Assert.Equal(TypeKind.Enum, compilation2.GetTypeByMetadataName("B").TypeKind); 116641Assert.Equal(TypeKind.Class, compilation2.GetTypeByMetadataName("C").TypeKind); 116642Assert.Equal(TypeKind.Delegate, compilation2.GetTypeByMetadataName("D").TypeKind); 116643Assert.Equal(TypeKind.Interface, compilation2.GetTypeByMetadataName("I1").TypeKind); 116650Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind); 116651Assert.Equal(TypeKind.Enum, compilation3.GetTypeByMetadataName("B").TypeKind); 116652Assert.Equal(TypeKind.Class, compilation3.GetTypeByMetadataName("C").TypeKind); 116653Assert.Equal(TypeKind.Delegate, compilation3.GetTypeByMetadataName("D").TypeKind); 116654Assert.Equal(TypeKind.Interface, compilation3.GetTypeByMetadataName("I1").TypeKind); 116670var a = compilation4.GetTypeByMetadataName("A"); 116671var b = compilation4.GetTypeByMetadataName("B"); 116672var c = compilation4.GetTypeByMetadataName("C"); 116673var d = compilation4.GetTypeByMetadataName("D"); 116674var i1 = compilation4.GetTypeByMetadataName("I1"); 116738a = compilation6.GetTypeByMetadataName("A"); 116739b = compilation6.GetTypeByMetadataName("B"); 116740c = compilation6.GetTypeByMetadataName("C"); 116741d = compilation6.GetTypeByMetadataName("D"); 116742i1 = compilation6.GetTypeByMetadataName("I1"); 116759Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind); 116760Assert.Equal(TypeKind.Enum, compilation7.GetTypeByMetadataName("B").TypeKind); 116761Assert.Equal(TypeKind.Class, compilation7.GetTypeByMetadataName("C").TypeKind); 116762Assert.Equal(TypeKind.Delegate, compilation7.GetTypeByMetadataName("D").TypeKind); 116763Assert.Equal(TypeKind.Interface, compilation7.GetTypeByMetadataName("I1").TypeKind); 124132NamedTypeSymbol b = compilation.GetTypeByMetadataName("B`12"); 145771var interfaces = comp.GetTypeByMetadataName("C").InterfacesNoUseSiteDiagnostics(); 157921var i3 = comp.GetTypeByMetadataName("I3"); 157955var i3 = comp.GetTypeByMetadataName("I3"); 157993var i3 = comp.GetTypeByMetadataName("I3"); 158021var i3 = comp.GetTypeByMetadataName("I3"); 158053var i3 = comp.GetTypeByMetadataName("I3"); 158222var i3 = comp.GetTypeByMetadataName("I3"); 158263var i3 = comp.GetTypeByMetadataName("I3"); 158303var i3 = comp.GetTypeByMetadataName("I3"); 158481var i3 = comp.GetTypeByMetadataName("I3"); 158517var i3 = comp.GetTypeByMetadataName("I3"); 158559var i3 = comp.GetTypeByMetadataName("I3"); 158640var i3 = comp.GetTypeByMetadataName("I3"); 158672var i3 = comp.GetTypeByMetadataName("I3"); 158706var i3 = comp.GetTypeByMetadataName("I3");
Semantics\NullCoalesceAssignmentTests.cs (5)
33var cType = comp.GetTypeByMetadataName("C"); 70var cType = comp.GetTypeByMetadataName("C"); 71var dType = comp.GetTypeByMetadataName("D"); 113var cType = comp.GetTypeByMetadataName("C"); 114var dType = comp.GetTypeByMetadataName("D");
Semantics\OperatorTests.cs (3)
7507type = compilation.GetTypeByMetadataName(typeNames[name]); 7861types[i] = compilation.GetTypeByMetadataName(typeNames[i]); 8021types[i] = compilation.GetTypeByMetadataName(typeNames[i]);
Semantics\RawInterpolationTests_Handler.cs (24)
5107var sParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 5144var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5228var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5231var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5315var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5318var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 5405var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5408var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 5492var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5495var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5579var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5582var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 5626var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5629var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 5673var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5676var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Skip(1).Single(); 5762var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5765var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5851var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5854var cParam = comp.GetTypeByMetadataName("C").GetMethod(".ctor").Parameters.Single(); 5944var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5947var cParam = comp.GetTypeByMetadataName("C`1").GetMethod("M").Parameters.Single(); 5974var customHandler = comp.GetTypeByMetadataName("CustomHandler"); 5977var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.First();
Semantics\RefFieldTests.cs (4)
2101var type = (NamedTypeSymbol)comp.GetTypeByMetadataName("E"); 10214Assert.True(comp.GetTypeByMetadataName("StructWithRefField").IsManagedTypeNoUseSiteDiagnostics); 10259Assert.True(comp.GetTypeByMetadataName("StructWithIndirectRefField").IsManagedTypeNoUseSiteDiagnostics); 10290Assert.True(comp.GetTypeByMetadataName("StructWithIndirectRefField").IsManagedTypeNoUseSiteDiagnostics);
Semantics\TopLevelStatementsTests.cs (7)
1679var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 1852var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 2078var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 2242var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 2420var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 3935var testType = ((Compilation)comp).GetTypeByMetadataName("args"); 4084var testType = ((Compilation)comp).GetTypeByMetadataName("args");
Semantics\UninitializedNonNullableFieldTests.cs (2)
2751var property = comp.GetTypeByMetadataName("C").GetMember("S"); 2772var property = comp.GetTypeByMetadataName("C").GetMember("S");
Semantics\UseSiteErrorTests.cs (35)
2309Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind); 2310Assert.Equal(TypeKind.Enum, compilation1.GetTypeByMetadataName("B").TypeKind); 2311Assert.Equal(TypeKind.Class, compilation1.GetTypeByMetadataName("C").TypeKind); 2312Assert.Equal(TypeKind.Delegate, compilation1.GetTypeByMetadataName("D").TypeKind); 2313Assert.Equal(TypeKind.Interface, compilation1.GetTypeByMetadataName("I1").TypeKind); 2327Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind); 2328Assert.Equal(TypeKind.Enum, compilation2.GetTypeByMetadataName("B").TypeKind); 2329Assert.Equal(TypeKind.Class, compilation2.GetTypeByMetadataName("C").TypeKind); 2330Assert.Equal(TypeKind.Delegate, compilation2.GetTypeByMetadataName("D").TypeKind); 2331Assert.Equal(TypeKind.Interface, compilation2.GetTypeByMetadataName("I1").TypeKind); 2338Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind); 2339Assert.Equal(TypeKind.Enum, compilation3.GetTypeByMetadataName("B").TypeKind); 2340Assert.Equal(TypeKind.Class, compilation3.GetTypeByMetadataName("C").TypeKind); 2341Assert.Equal(TypeKind.Delegate, compilation3.GetTypeByMetadataName("D").TypeKind); 2342Assert.Equal(TypeKind.Interface, compilation3.GetTypeByMetadataName("I1").TypeKind); 2358var a = compilation4.GetTypeByMetadataName("A"); 2359var b = compilation4.GetTypeByMetadataName("B"); 2360var c = compilation4.GetTypeByMetadataName("C"); 2361var d = compilation4.GetTypeByMetadataName("D"); 2362var i1 = compilation4.GetTypeByMetadataName("I1"); 2383Assert.Equal(TypeKind.Struct, compilation5.GetTypeByMetadataName("A").TypeKind); 2384Assert.Equal(TypeKind.Enum, compilation5.GetTypeByMetadataName("B").TypeKind); 2385Assert.Equal(TypeKind.Class, compilation5.GetTypeByMetadataName("C").TypeKind); 2386Assert.Equal(TypeKind.Delegate, compilation5.GetTypeByMetadataName("D").TypeKind); 2387Assert.Equal(TypeKind.Interface, compilation5.GetTypeByMetadataName("I1").TypeKind); 2403a = compilation6.GetTypeByMetadataName("A"); 2404b = compilation6.GetTypeByMetadataName("B"); 2405c = compilation6.GetTypeByMetadataName("C"); 2406d = compilation6.GetTypeByMetadataName("D"); 2407i1 = compilation6.GetTypeByMetadataName("I1"); 2424Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind); 2425Assert.Equal(TypeKind.Enum, compilation7.GetTypeByMetadataName("B").TypeKind); 2426Assert.Equal(TypeKind.Class, compilation7.GetTypeByMetadataName("C").TypeKind); 2427Assert.Equal(TypeKind.Delegate, compilation7.GetTypeByMetadataName("D").TypeKind); 2428Assert.Equal(TypeKind.Interface, compilation7.GetTypeByMetadataName("I1").TypeKind);
SourceGeneration\GeneratorDriverTests.cs (2)
919var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => { dSymbol = sgc.Compilation.GetTypeByMetadataName("D"); }, source = "public class E : D {}"); 947var generator2 = new CallbackGenerator2((ic) => { }, (sgc) => { dSymbol = sgc.Compilation.GetTypeByMetadataName("D"); }, source = "public class E : D {}");
SourceGeneration\SyntaxAwareGeneratorTests.cs (1)
790var dType = ctx.SemanticModel.Compilation.GetTypeByMetadataName("D");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (575)
Compilation\CompilationAPITests.cs (2)
3644var type = ((Compilation)current).GetTypeByMetadataName("C"); 3672var type = ((Compilation)current).GetTypeByMetadataName("C");
Compilation\ReferenceManagerTests.cs (2)
2140compilation.GetTypeByMetadataName("System.Int32").GetMembers(); 2144Assert.Throws<ObjectDisposedException>(() => compilation.GetTypeByMetadataName("System.Int64").GetMembers());
Compilation\SemanticModelAPITests.cs (1)
4452var method = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMembers("M").Single().GetPublicSymbol();
CrossLanguageTests.cs (1)
37var t = comp.GetTypeByMetadataName("I");
DeclarationTests.cs (27)
406var type1 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 411var type2 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 419var type3 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 459var type1 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 464var type2 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.D"); 502var type1 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 507var type2 = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.C"); 555var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 558var type1b = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.D"); 563var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.C"); 566var type2b = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.D"); 610var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.C"); 613var type1b = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.D"); 618var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.C"); 621var type2b = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.D"); 659var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.E"); 664var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.E"); 702var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.S"); 707var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.S"); 749var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.I"); 754var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.I"); 794var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.E"); 799var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.E"); 839var type1a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.N2.N3.E"); 844var type2a = (SourceNamedTypeSymbol)compilation.GetTypeByMetadataName("N1.E"); 872var type1 = (SourceNamedTypeSymbol)compilation1.GetTypeByMetadataName("N1.N2.N3.E"); 873var type2 = (SourceNamedTypeSymbol)compilation2.GetTypeByMetadataName("N1.N2.N3.E");
DocumentationComments\MethodDocumentationCommentTests.cs (3)
238var main = compilation.GetTypeByMetadataName("Test").GetMember<MethodSymbol>("Main"); 243main = compilation.GetTypeByMetadataName("Test").GetMember<MethodSymbol>("Main"); 248main = compilation.GetTypeByMetadataName("Test").GetMember<MethodSymbol>("Main");
SymbolDisplay\SymbolDisplayTests.cs (1)
5115var cTest = comp.GetTypeByMetadataName("CTest");
Symbols\CSharpCompilerFeatureRequiredTests.cs (18)
144var onType = comp.GetTypeByMetadataName("OnType"); 148var onMethod = comp.GetTypeByMetadataName("OnMethod"); 152var onMethodReturn = comp.GetTypeByMetadataName("OnMethodReturn"); 156var onParameter = comp.GetTypeByMetadataName("OnParameter"); 162var onField = comp.GetTypeByMetadataName("OnField"); 166var onProperty = comp.GetTypeByMetadataName("OnProperty"); 170var onPropertyGetter = comp.GetTypeByMetadataName("OnPropertyGetter"); 177var onPropertySetter = comp.GetTypeByMetadataName("OnPropertySetter"); 184var onEvent = comp.GetTypeByMetadataName("OnEvent"); 188var onEventAdder = comp.GetTypeByMetadataName("OnEventAdder"); 195var onEventRemover = comp.GetTypeByMetadataName("OnEventRemover"); 202var onEnum = comp.GetTypeByMetadataName("OnEnum"); 205var onEnumMember = comp.GetTypeByMetadataName("OnEnumMember"); 209var onClassTypeParameter = comp.GetTypeByMetadataName("OnClassTypeParameter`1"); 213var onMethodTypeParameter = comp.GetTypeByMetadataName("OnMethodTypeParameter"); 219var onDelegateType = comp.GetTypeByMetadataName("OnDelegateType"); 222var onIndexedPropertyParameter = comp.GetTypeByMetadataName("OnIndexedPropertyParameter"); 227var onThisParameterIndexer = comp.GetTypeByMetadataName("OnThisIndexerParameter");
Symbols\CustomModifiersTests.cs (37)
65var test = compilation.GetTypeByMetadataName("Test1").GetMember<IMethodSymbol>("Test"); 135var test = compilation.GetTypeByMetadataName("Test1").GetMember<IMethodSymbol>("Test"); 290var cl3 = compilation.GetTypeByMetadataName("CL3"); 375var cl3 = compilation.GetTypeByMetadataName("CL3"); 448var cl3 = compilation.GetTypeByMetadataName("CL3"); 521var cl3 = compilation.GetTypeByMetadataName("CL3"); 595var cl3 = compilation.GetTypeByMetadataName("CL3"); 700var cl3 = compilation.GetTypeByMetadataName("CL3"); 704var cl1 = compilation.GetTypeByMetadataName("CL1`1"); 810var cl3 = compilation.GetTypeByMetadataName("CL3"); 814var cl1 = compilation.GetTypeByMetadataName("CL1`1"); 920var cl3 = compilation.GetTypeByMetadataName("CL3"); 924var cl1 = compilation.GetTypeByMetadataName("CL1`1"); 1030var cl3 = compilation.GetTypeByMetadataName("CL3"); 1034var cl1 = compilation.GetTypeByMetadataName("CL1`1"); 1124var cl3 = compilation.GetTypeByMetadataName("CL3"); 1231var cl3 = compilation.GetTypeByMetadataName("CL3"); 1306var cl3 = compilation.GetTypeByMetadataName("CL3"); 1373var cl2 = compilation.GetTypeByMetadataName("CL2"); 1459var base1 = compilation.GetTypeByMetadataName("CL2").BaseType(); 1460var base2 = compilation.GetTypeByMetadataName("CL3").BaseType(); 1461var base3 = compilation.GetTypeByMetadataName("CL4").BaseType(); 1518var test = compilation1.GetTypeByMetadataName("Module1").GetMember<MethodSymbol>("Test"); 1527test = compilation2.GetTypeByMetadataName("Module1").GetMember<MethodSymbol>("Test"); 1715Assert.Equal("ITest0<T modopt(System.Runtime.CompilerServices.IsConst) modopt(System.Runtime.CompilerServices.IsLong)>", compilation.GetTypeByMetadataName("ITest1`1").Interfaces().First().ToTestDisplayString()); 1716Assert.Equal("ITest0<T modopt(System.Runtime.CompilerServices.IsConst)>", compilation.GetTypeByMetadataName("ITest2`1").Interfaces().First().ToTestDisplayString()); 1757Assert.Equal("ITest0<T modopt(System.Runtime.CompilerServices.IsLong) modopt(System.Runtime.CompilerServices.IsConst)>", compilation.GetTypeByMetadataName("ITest1`1").Interfaces().First().ToTestDisplayString()); 1758Assert.Equal("ITest0<T modopt(System.Runtime.CompilerServices.IsConst)>", compilation.GetTypeByMetadataName("ITest2`1").Interfaces().First().ToTestDisplayString()); 2286var cl2 = compilation.GetTypeByMetadataName("CL2"); 2332var cl3 = compilation.GetTypeByMetadataName("CL3"); 2475var cl1 = compilation.GetTypeByMetadataName("CL1`1"); 2596var cl2 = compilation.GetTypeByMetadataName("CL2"); 2601var cl3 = compilation.GetTypeByMetadataName("CL3"); 2710var cl2 = compilation.GetTypeByMetadataName("CL2"); 2715var cl3 = compilation.GetTypeByMetadataName("CL3"); 2804var cl2 = compilation.GetTypeByMetadataName("CL2"); 2809var cl3 = compilation.GetTypeByMetadataName("CL3");
Symbols\DefaultInterfaceImplementationTests.cs (235)
974var test1 = compilation1.GetTypeByMetadataName("Test1"); 1049var test1 = compilation1.GetTypeByMetadataName("Test1"); 1128var test1 = compilation1.GetTypeByMetadataName("Test1"); 1207var test1 = compilation1.GetTypeByMetadataName("Test1"); 1288var test1 = compilation1.GetTypeByMetadataName("Test1"); 1372var test1 = compilation1.GetTypeByMetadataName("Test1"); 1460var test1 = compilation1.GetTypeByMetadataName("Test1"); 1548var test1 = compilation1.GetTypeByMetadataName("Test1"); 1593var test1 = compilation1.GetTypeByMetadataName("Test1"); 1627var test2 = compilation3.GetTypeByMetadataName("Test2"); 1683var test2 = compilation3.GetTypeByMetadataName("Test2"); 1749var test2 = compilation3.GetTypeByMetadataName("Test2"); 1784var test1 = compilation1.GetTypeByMetadataName("Test1"); 1824var test2 = compilation3.GetTypeByMetadataName("Test2"); 1881var test1 = compilation1.GetTypeByMetadataName("Test1"); 1915var test2 = compilation2.GetTypeByMetadataName("Test2"); 1933test2 = compilation3.GetTypeByMetadataName("Test2"); 2026var test1 = compilation1.GetTypeByMetadataName("Test1"); 2112var test1 = compilation1.GetTypeByMetadataName("Test1"); 2186var test2 = compilation2.GetTypeByMetadataName("Test2"); 2208test2 = compilation3.GetTypeByMetadataName("Test2"); 2271var test1 = compilation2.GetTypeByMetadataName("Test1"); 2340var test1 = compilation2.GetTypeByMetadataName("Test1"); 2413var test1 = compilation2.GetTypeByMetadataName("Test1"); 2486var test1 = compilation2.GetTypeByMetadataName("Test1"); 3416var test1 = compilation1.GetTypeByMetadataName("Test1"); 3484var test1 = compilation1.GetTypeByMetadataName("Test1"); 3571var test1 = compilation1.GetTypeByMetadataName("Test1"); 3635var test1 = compilation1.GetTypeByMetadataName("Test1"); 4494var test2 = compilation3.GetTypeByMetadataName("Test2"); 4495var i1 = compilation3.GetTypeByMetadataName("I1"); 5270var test1 = compilation1.GetTypeByMetadataName("Test1"); 5323var test1 = compilation1.GetTypeByMetadataName("Test1"); 6035var test2 = compilation3.GetTypeByMetadataName("Test2"); 6036var i1 = compilation3.GetTypeByMetadataName("I1"); 7500var test2 = compilation3.GetTypeByMetadataName("Test2"); 7501var i1 = compilation3.GetTypeByMetadataName("I1"); 8432var i1 = compilation1.GetTypeByMetadataName("I1"); 8824var i1 = compilation1.GetTypeByMetadataName("I1"); 8971var test1 = compilation1.GetTypeByMetadataName("Test1"); 8972var i1 = compilation1.GetTypeByMetadataName("I1"); 9111var test1 = compilation1.GetTypeByMetadataName("Test1"); 9112var i1 = compilation1.GetTypeByMetadataName("I1"); 9271ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal, isStatic: isStatic); 9324var test2 = compilation.GetTypeByMetadataName(className); 9325var i1 = compilation.GetTypeByMetadataName("I1"); 9468ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), accessibility, isStatic: isStatic); 9541ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 9840ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 9905ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 9990ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 10090var test1 = compilation1.GetTypeByMetadataName("Test1"); 10091var i1 = compilation1.GetTypeByMetadataName("I1"); 10220var test1 = compilation1.GetTypeByMetadataName("Test1"); 10221var test2 = compilation1.GetTypeByMetadataName("Test2"); 10222var i1 = compilation1.GetTypeByMetadataName("I1"); 10325var test1 = compilation1.GetTypeByMetadataName("Test1"); 10326var test2 = compilation1.GetTypeByMetadataName("Test2"); 10327var i1 = compilation1.GetTypeByMetadataName("I1"); 10608var test1 = compilation1.GetTypeByMetadataName("Test1"); 10609var test2 = compilation1.GetTypeByMetadataName("Test2"); 10610var i1 = compilation1.GetTypeByMetadataName("I1"); 10728var test1 = compilation1.GetTypeByMetadataName("Test1"); 10729var test2 = compilation1.GetTypeByMetadataName("Test2"); 10730var i1 = compilation1.GetTypeByMetadataName("I1"); 10922var i1 = compilation2.GetTypeByMetadataName("I1"); 11064var i1 = compilation1.GetTypeByMetadataName("I1"); 11171var i1 = compilation1.GetTypeByMetadataName("I1"); 11896ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Protected); 12011ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedOrInternal); 12134ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedAndInternal); 12232ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Protected); 12294ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedOrInternal); 12356ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedAndInternal); 12630var i1 = compilation2.GetTypeByMetadataName("I1"); 12718var i1 = compilation2.GetTypeByMetadataName("I1"); 12806var i1 = compilation2.GetTypeByMetadataName("I1"); 13116var i1 = compilation1.GetTypeByMetadataName("I1"); 14047return GetSingleProperty(compilation.GetTypeByMetadataName(containerName)); 14082var i1 = compilation1.GetTypeByMetadataName("I1"); 14393var test1 = compilation1.GetTypeByMetadataName("Test1"); 14394var i1 = compilation1.GetTypeByMetadataName("I1"); 14735var test1 = compilation1.GetTypeByMetadataName("Test1"); 14736var i1 = compilation1.GetTypeByMetadataName("I1"); 14939var i1 = compilation2.GetTypeByMetadataName("I1"); 15038var test2 = compilation.GetTypeByMetadataName(className); 15039var i1 = compilation.GetTypeByMetadataName("I1"); 16011var test1 = compilation1.GetTypeByMetadataName("Test1"); 16012var i1 = compilation1.GetTypeByMetadataName("I1"); 16313var test1 = compilation1.GetTypeByMetadataName("Test1"); 16314var test2 = compilation1.GetTypeByMetadataName("Test2"); 16585var test1 = compilation1.GetTypeByMetadataName("Test1"); 16586var test2 = compilation1.GetTypeByMetadataName("Test2"); 16590var i1 = compilation1.GetTypeByMetadataName("I" + i); 17021var test1 = compilation1.GetTypeByMetadataName("Test1"); 17022var test2 = compilation1.GetTypeByMetadataName("Test2"); 17271var test1 = compilation1.GetTypeByMetadataName("Test1"); 17272var test2 = compilation1.GetTypeByMetadataName("Test2"); 17517var i1 = compilation2.GetTypeByMetadataName("I1"); 19898var i1 = compilation2.GetTypeByMetadataName("I1"); 23390var test1 = compilation1.GetTypeByMetadataName("Test1"); 23391var i1 = compilation1.GetTypeByMetadataName("I1"); 26838var i1 = compilation1.GetTypeByMetadataName("I1"); 27675return GetSingleEvent(compilation.GetTypeByMetadataName(containerName)); 27710var i1 = compilation1.GetTypeByMetadataName("I1"); 27977var test1 = compilation1.GetTypeByMetadataName("Test1"); 27978var i1 = compilation1.GetTypeByMetadataName("I1"); 28234var test1 = compilation1.GetTypeByMetadataName("Test1"); 28235var i1 = compilation1.GetTypeByMetadataName("I1"); 28485var i1 = compilation2.GetTypeByMetadataName("I1"); 28540var test2 = compilation.GetTypeByMetadataName(className); 28541var i1 = compilation.GetTypeByMetadataName("I1"); 29509var test1 = compilation1.GetTypeByMetadataName("Test1"); 29510var i1 = compilation1.GetTypeByMetadataName("I1"); 29702var test1 = compilation1.GetTypeByMetadataName("Test1"); 29703var test2 = compilation1.GetTypeByMetadataName("Test2"); 29998var test1 = compilation1.GetTypeByMetadataName("Test1"); 29999var test2 = compilation1.GetTypeByMetadataName("Test2"); 30003var i1 = compilation1.GetTypeByMetadataName("I" + i); 30444var test1 = compilation1.GetTypeByMetadataName("Test1"); 30445var test2 = compilation1.GetTypeByMetadataName("Test2"); 30665var test1 = compilation1.GetTypeByMetadataName("Test1"); 30666var test2 = compilation1.GetTypeByMetadataName("Test2"); 30922var i1 = compilation2.GetTypeByMetadataName("I1"); 34989var test1 = compilation2.GetTypeByMetadataName("Test1"); 35013test1 = compilation3.GetTypeByMetadataName("Test1"); 35083var test1 = compilation2.GetTypeByMetadataName("Test1"); 35111test1 = compilation3.GetTypeByMetadataName("Test1"); 35181var test1 = compilation2.GetTypeByMetadataName("Test1"); 35206test1 = compilation3.GetTypeByMetadataName("Test1"); 35277var test1 = compilation2.GetTypeByMetadataName("Test1"); 35301test1 = compilation3.GetTypeByMetadataName("Test1"); 35382var test1 = compilation2.GetTypeByMetadataName("Test1"); 35473var test1 = compilation2.GetTypeByMetadataName("Test1"); 35582var test1 = compilation2.GetTypeByMetadataName("Test1"); 35695var test1 = compilation2.GetTypeByMetadataName("Test1"); 35808var test1 = compilation2.GetTypeByMetadataName("Test1"); 35914var test1 = compilation2.GetTypeByMetadataName("Test1"); 36231var test1 = compilation2.GetTypeByMetadataName("Test1"); 39526var test1 = compilation2.GetTypeByMetadataName("Test1"); 43737var i1 = compilation.GetTypeByMetadataName("I1"); 44648Assert.Empty(compilation1.GetTypeByMetadataName("I1").GetMembers("I1")); 54383var i1 = compilation1.GetTypeByMetadataName("I1"); 54385var test2 = compilation1.GetTypeByMetadataName("Test2"); 54456var i1 = compilation1.GetTypeByMetadataName("I1"); 54458var test2 = compilation1.GetTypeByMetadataName("Test2"); 54556var i1 = compilation1.GetTypeByMetadataName("I1"); 54558var test2 = compilation1.GetTypeByMetadataName("Test2"); 54627var i1 = compilation1.GetTypeByMetadataName("I1"); 54629var test2 = compilation1.GetTypeByMetadataName("Test2"); 54695var i1 = compilation1.GetTypeByMetadataName("I1"); 54697var test2 = compilation1.GetTypeByMetadataName("Test2"); 54789var i1 = compilation1.GetTypeByMetadataName("I1"); 54791var test2 = compilation1.GetTypeByMetadataName("Test2"); 54883var i1 = compilation1.GetTypeByMetadataName("I1"); 54885var test2 = compilation1.GetTypeByMetadataName("Test2"); 54971var i1 = compilation1.GetTypeByMetadataName("I1"); 54973var test2 = compilation1.GetTypeByMetadataName("Test2"); 62379var c0 = compilation1.GetTypeByMetadataName("C0"); 62472var test = compilation1.GetTypeByMetadataName("Test"); 62516var c0 = compilation1.GetTypeByMetadataName("C0"); 62517var test = compilation1.GetTypeByMetadataName("Test"); 62531c0 = compilation1.GetTypeByMetadataName("C0"); 62532test = compilation1.GetTypeByMetadataName("Test"); 63129var i1 = compilation1.GetTypeByMetadataName("I1"); 63130var i2 = compilation1.GetTypeByMetadataName("I2"); 63131var c1 = compilation1.GetTypeByMetadataName("C1"); 63132var test1 = compilation1.GetTypeByMetadataName("Test1"); 63133var test2 = compilation1.GetTypeByMetadataName("Test2"); 63134var test3 = compilation1.GetTypeByMetadataName("Test3"); 63135var test4 = compilation1.GetTypeByMetadataName("Test4"); 63335var i1 = compilation1.GetTypeByMetadataName("I1"); 63336var i2 = compilation1.GetTypeByMetadataName("I2"); 63337var c1 = compilation1.GetTypeByMetadataName("C1"); 63338var test1 = compilation1.GetTypeByMetadataName("Test1"); 63339var test2 = compilation1.GetTypeByMetadataName("Test2"); 63340var test3 = compilation1.GetTypeByMetadataName("Test3"); 63341var test4 = compilation1.GetTypeByMetadataName("Test4"); 63501var i1 = compilation1.GetTypeByMetadataName("I1"); 63502var i2 = compilation1.GetTypeByMetadataName("I2"); 63503var c1 = compilation1.GetTypeByMetadataName("C1"); 63504var test1 = compilation1.GetTypeByMetadataName("Test1"); 63505var test2 = compilation1.GetTypeByMetadataName("Test2"); 63506var test3 = compilation1.GetTypeByMetadataName("Test3"); 63507var test4 = compilation1.GetTypeByMetadataName("Test4"); 63677var i1 = compilation1.GetTypeByMetadataName("I1"); 63678var i2 = compilation1.GetTypeByMetadataName("I2"); 63679var c1 = compilation1.GetTypeByMetadataName("C1"); 63680var test1 = compilation1.GetTypeByMetadataName("Test1"); 63681var test2 = compilation1.GetTypeByMetadataName("Test2"); 63682var test3 = compilation1.GetTypeByMetadataName("Test3"); 63683var test4 = compilation1.GetTypeByMetadataName("Test4"); 63860var i1 = compilation1.GetTypeByMetadataName("I1"); 63861var c3 = compilation1.GetTypeByMetadataName("C3"); 64067var i1 = compilation1.GetTypeByMetadataName("I1"); 64068var i2 = compilation1.GetTypeByMetadataName("I2"); 64069var i3 = compilation1.GetTypeByMetadataName("I3"); 64070var test2 = compilation1.GetTypeByMetadataName("Test2"); 64071var test3 = compilation1.GetTypeByMetadataName("Test3"); 64210var i1 = compilation1.GetTypeByMetadataName("I1"); 64211var i2 = compilation1.GetTypeByMetadataName("I2"); 64212var i3 = compilation1.GetTypeByMetadataName("I3"); 64213var test2 = compilation1.GetTypeByMetadataName("Test2"); 64214var test3 = compilation1.GetTypeByMetadataName("Test3"); 64326var i1 = compilation1.GetTypeByMetadataName("I1"); 64327var i2 = compilation1.GetTypeByMetadataName("I2"); 64328var i3 = compilation1.GetTypeByMetadataName("I3"); 64329var test2 = compilation1.GetTypeByMetadataName("Test2"); 64330var test3 = compilation1.GetTypeByMetadataName("Test3"); 64447var i1 = compilation1.GetTypeByMetadataName("I1"); 64448var i2 = compilation1.GetTypeByMetadataName("I2"); 64449var i3 = compilation1.GetTypeByMetadataName("I3"); 64450var test2 = compilation1.GetTypeByMetadataName("Test2"); 64451var test3 = compilation1.GetTypeByMetadataName("Test3"); 64534var i1 = compilation1.GetTypeByMetadataName("I1"); 64535var c2 = compilation1.GetTypeByMetadataName("C2"); 64614var i1 = compilation1.GetTypeByMetadataName("I1"); 64615var c2 = compilation1.GetTypeByMetadataName("C2"); 64688var i1 = compilation1.GetTypeByMetadataName("I1"); 64689var c1 = compilation1.GetTypeByMetadataName("C1"); 64690var c2 = compilation1.GetTypeByMetadataName("C2"); 64767var i1 = compilation1.GetTypeByMetadataName("I1"); 64768var c1 = compilation1.GetTypeByMetadataName("C1"); 64769var c2 = compilation1.GetTypeByMetadataName("C2"); 67147var i1 = compilation1.GetTypeByMetadataName("I1"); 67212var i1 = compilation1.GetTypeByMetadataName("I1"); 67213var i2 = compilation1.GetTypeByMetadataName("I2"); 67329var i1 = compilation1.GetTypeByMetadataName("I1"); 67396var i1 = compilation1.GetTypeByMetadataName("I1"); 67397var i2 = compilation1.GetTypeByMetadataName("I2"); 67517var i1 = compilation1.GetTypeByMetadataName("I1"); 67587var i1 = compilation1.GetTypeByMetadataName("I1"); 67588var i2 = compilation1.GetTypeByMetadataName("I2"); 68008var c1 = compilation1.GetTypeByMetadataName("C1"); 68072var c1 = compilation1.GetTypeByMetadataName("C1");
Symbols\FunctionPointerTypeSymbolTests.cs (36)
41var c = comp.GetTypeByMetadataName("C"); 110var mParams = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters; 194var c = comp.GetTypeByMetadataName("C"); 242Assert.Null(compWithMissingMembers.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvCdecl")); 243Assert.Null(compWithMissingMembers.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvThiscall")); 244Assert.Null(compWithMissingMembers.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvFastcall")); 245Assert.Null(compWithMissingMembers.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvStdcall")); 262var c = comp.GetTypeByMetadataName("C"); 324var c = comp.GetTypeByMetadataName("C"); 374var c = comp.GetTypeByMetadataName("C"); 467var c = comp.GetTypeByMetadataName("C"); 569var c = comp.GetTypeByMetadataName("C"); 677var c = comp.GetTypeByMetadataName("C"); 707var c = comp.GetTypeByMetadataName("C"); 724var c = comp.GetTypeByMetadataName("C"); 743var c = comp.GetTypeByMetadataName("C"); 761var c = comp.GetTypeByMetadataName("C"); 780var c = comp.GetTypeByMetadataName("C"); 798var c = comp.GetTypeByMetadataName("C"); 816var c = comp.GetTypeByMetadataName("C"); 834var c = comp.GetTypeByMetadataName("C"); 852var c = comp.GetTypeByMetadataName("C"); 870var c = comp.GetTypeByMetadataName("C"); 888var c = comp.GetTypeByMetadataName("C"); 1054var testClass = comp.GetTypeByMetadataName("Test1")!; 1515var c = comp.GetTypeByMetadataName("C"); 1530var cdeclType = comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvCdecl"); 1565var c = comp.GetTypeByMetadataName("C")!; 1649var cdeclType = comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvCdecl"); 1650var stdcallType = comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvStdcall"); 1960var testConvention = otherCorLib.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvTest"); 1982var thiscallMod = CSharpCustomModifier.CreateOptional(comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvThiscall")); 1983var stdcallMod = CSharpCustomModifier.CreateOptional(comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvStdcall")); 2086var callConvMod = CSharpCustomModifier.CreateOptional(comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConv")); 2138var thiscallMod = CSharpCustomModifier.CreateOptional(comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvThiscall")); 2139var stdcallMod = CSharpCustomModifier.CreateOptional(comp.GetTypeByMetadataName("System.Runtime.CompilerServices.CallConvStdcall"));
Symbols\GenericConstraintTests.cs (9)
3751NamedTypeSymbol i2 = compilation.GetTypeByMetadataName("I2"); 3785NamedTypeSymbol i2 = compilation.GetTypeByMetadataName("I2`2"); 3819NamedTypeSymbol i2 = compilation.GetTypeByMetadataName("I2`1"); 3853NamedTypeSymbol i2 = compilation.GetTypeByMetadataName("I2`01"); 3902NamedTypeSymbol i2 = compilation.GetTypeByMetadataName("I2`1"); 3913Assert.Same(iEquatable, compilation.GetTypeByMetadataName("System.IEquatable`1")); 4137NamedTypeSymbol containingType = compilation.GetTypeByMetadataName("I"); 7315var c = comp.GetTypeByMetadataName("C"); 7372var c = comp.GetTypeByMetadataName("C");
Symbols\InterfaceImplementationTests.cs (2)
2494var baseType = comp.GetTypeByMetadataName("StringComparer"); 2495var derivedType = comp.GetTypeByMetadataName("OneToOneUnicodeComparer");
Symbols\Metadata\MetadataMemberTests.cs (11)
621var test1 = comp1.GetTypeByMetadataName("Test"); 631var test2 = comp2.GetTypeByMetadataName("Test"); 661var test1 = comp1.GetTypeByMetadataName("Test"); 672var test2 = comp2.GetTypeByMetadataName("Test"); 735var c = compilation.GetTypeByMetadataName("C"); 742c = compilation.GetTypeByMetadataName("C"); 749c = compilation.GetTypeByMetadataName("C"); 756c = compilation.GetTypeByMetadataName("C"); 797var c = compilation.GetTypeByMetadataName("C"); 804c = compilation.GetTypeByMetadataName("C"); 811c = compilation.GetTypeByMetadataName("C");
Symbols\Metadata\MetadataTypeTests.cs (1)
517Assert.Equal(stateMachineClass, comp.GetTypeByMetadataName("C+<I<System.Int32>.F>d__0")); // GetTypeByMetadataName works.
Symbols\Metadata\PE\BaseTypeResolution.cs (6)
341var test1 = compilation1.GetTypeByMetadataName("Test1"); 342var test2 = compilation1.GetTypeByMetadataName("Test2"); 361var m3 = compilation2.GetTypeByMetadataName("M3"); 362var m4 = compilation2.GetTypeByMetadataName("M4"); 371m3 = compilation3.GetTypeByMetadataName("M3"); 372m4 = compilation3.GetTypeByMetadataName("M4");
Symbols\Metadata\PE\HasUnsupportedMetadata.cs (4)
160var c3 = compilation1.GetTypeByMetadataName("C3"); 364var c3 = compilation1.GetTypeByMetadataName("C3"); 392var vector = compilation1.GetTypeByMetadataName("Microsoft.VisualC.StlClr.IVector`1"); 402var typeX = compilation1.GetTypeByMetadataName("X");
Symbols\Metadata\PE\LoadingAttributes.cs (1)
1514Assert.Equal(expected, c.GetTypeByMetadataName("Test").GetAttributes().Single().ToString());
Symbols\Metadata\PE\LoadingMethods.cs (9)
1180foreach (var m in compilation.GetTypeByMetadataName("cls1").GetMembers()) 1185foreach (var m in compilation.GetTypeByMetadataName("Instance_vs_Static").GetMembers()) 1190foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue1").GetMembers()) 1195foreach (var m in compilation.GetTypeByMetadataName("ReturnAValue2").GetMembers()) 1200foreach (var m in compilation.GetTypeByMetadataName("Generic1").GetMembers()) 1205foreach (var m in compilation.GetTypeByMetadataName("Generic2").GetMembers()) 1210foreach (var m in compilation.GetTypeByMetadataName("HasParameter").GetMembers()) 1215foreach (var m in compilation.GetTypeByMetadataName("Virtual").GetMembers()) 1242foreach (var m in compilation.GetTypeByMetadataName("Microsoft.FSharp.Control.IDelegateEvent`1").GetMembers())
Symbols\Metadata\PE\NoPia.cs (2)
1417var i1F1 = compilationDerived.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("F1"); 1418var baseI1F1 = compilationDerived.GetTypeByMetadataName("Base").GetMember<MethodSymbol>("I1.F1");
Symbols\Metadata\PE\TypeForwarders.cs (2)
1893var forwarded = context.GetTypeByMetadataName("Forwarded`1"); 1894var resolved = context.GetTypeByMetadataName("B").BaseType().OriginalDefinition;
Symbols\MissingSpecialMember.cs (6)
162var lookupType = comp.GetTypeByMetadataName("System.String"); 239var lookupType = comp.GetTypeByMetadataName("System.Nullable`1"); 275var lookupType = comp.GetTypeByMetadataName("System.Type"); 308var lookupType = comp.GetTypeByMetadataName("System.Diagnostics.DebuggableAttribute+DebuggingModes"); 384var lookupType = comp.GetTypeByMetadataName("System.Threading.Tasks.Task`1"); 502var lookup = comp.GetTypeByMetadataName("System.Type");
Symbols\OverriddenOrHiddenMembersTests.cs (2)
3683var validatorBaseT = compilation.GetTypeByMetadataName("ValidatorBase`1"); 3939var validatorBaseT = compilation.GetTypeByMetadataName("ValidatorBase`1");
Symbols\RequiredMembersTests.cs (6)
2233var baseSymbol = comp.GetTypeByMetadataName("Base"); 2279var baseSymbol = comp.GetTypeByMetadataName("Derived"); 2315var baseSymbol = comp.GetTypeByMetadataName("Base"); 2572Assert.IsType<RetargetingNamedTypeSymbol>(comp.GetTypeByMetadataName("Base")); 2607Assert.IsType<RetargetingNamedTypeSymbol>(comp.GetTypeByMetadataName("Base")); 6568var c = comp.GetTypeByMetadataName("C`1");
Symbols\Retargeting\NoPia.cs (38)
2050NamedTypeSymbol lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2056NamedTypeSymbol attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2065lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2071attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2080lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2086attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2095lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2101attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2175NamedTypeSymbol lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2181NamedTypeSymbol attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2190lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2196attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2205lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2211attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2220lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2226attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2300NamedTypeSymbol lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2306NamedTypeSymbol attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2315lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2321attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2330lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2336attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2345lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2351attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2412NamedTypeSymbol lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2418NamedTypeSymbol attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2427lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2433attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2508NamedTypeSymbol lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2514NamedTypeSymbol attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2523lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2529attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2538lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2544attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2553lt = compilation.GetTypeByMetadataName("LocalTypes2"); 2559attrTest1 = compilation.GetTypeByMetadataName("AttrTest1"); 2675var test = compilation2.GetTypeByMetadataName("Test"); 2678var usePia1 = compilation2.GetTypeByMetadataName("UsePia1");
Symbols\Retargeting\RetargetCustomAttributes.cs (2)
349var c1 = comp3.GetTypeByMetadataName("C1"); 391var c1 = comp3.GetTypeByMetadataName("C1");
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (3)
463Assert.NotSame(compilation2.GetTypeByMetadataName("C1`1"), compilation3.GetTypeByMetadataName("C1`1")); 465var c2 = compilation3.GetTypeByMetadataName("C2`1");
Symbols\Retargeting\RetargetingTests.cs (5)
277var a_v2 = compilation1_v2.GetTypeByMetadataName("A"); 278var i_a_v2 = compilation1_v2.GetTypeByMetadataName("I`1").Construct(ImmutableArray.Create<TypeSymbol>(a_v2)); 299var i_ct_v2 = compilation1_v2.GetTypeByMetadataName("I`1").Construct(ImmutableArray.Create<TypeSymbol>(c.TypeParameters[0])); 906var c = compilation.GetTypeByMetadataName("Source"); 1072var m = finalComp.GetTypeByMetadataName("C").GetMethod("M");
Symbols\Source\EventTests.cs (1)
814var classSymbol = (PENamedTypeSymbol)comp.GetTypeByMetadataName("C");
Symbols\Source\FileModifierTests.cs (35)
1131Assert.Null(comp.GetTypeByMetadataName("<_>F<no checksum>__C")); 4142var sourceType = comp.GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C"); 4145Assert.Null(comp.GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__D")); 4146Assert.Null(comp.GetTypeByMetadataName("<>F1__C")); 4147Assert.Null(comp.GetTypeByMetadataName("F0__C")); 4148Assert.Null(comp.GetTypeByMetadataName("<file>F0__C")); 4149Assert.Null(comp.GetTypeByMetadataName("C")); 4150Assert.Null(comp.GetTypeByMetadataName("C`1")); 4158var metadataType = comp2.GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C"); 4161Assert.Null(comp2.GetTypeByMetadataName("C")); 4177var sourceType = comp.GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C`1"); 4179Assert.Null(comp.GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C")); 4180Assert.Null(comp.GetTypeByMetadataName("C")); 4181Assert.Null(comp.GetTypeByMetadataName("C`1")); 4190var metadataType = comp2.GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C`1"); 4193Assert.Null(comp2.GetTypeByMetadataName("C`1")); 4215var sourceType = comp.GetTypeByMetadataName("Outer.<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C"); 4220Assert.Null(comp.GetTypeByMetadataName("Outer.C")); 4240var sourceType = comp.GetTypeByMetadataName("<file1>F96B1D9CB33A43D51528FE81EDAFE5AE31358FE749929AC76B76C64B60DEF129D__C"); 4243var sourceTypeCByMetadataName = comp.GetTypeByMetadataName("C"); 4255var metadataType = comp2.GetTypeByMetadataName("<file1>F96B1D9CB33A43D51528FE81EDAFE5AE31358FE749929AC76B76C64B60DEF129D__C"); 4258var metadataTypeCByMetadataName = comp2.GetTypeByMetadataName("C"); 4283var sourceType = comp.GetTypeByMetadataName(metadataName); 4285Assert.Null(comp.GetTypeByMetadataName("C")); 4311var sourceType = ((Compilation)comp).GetTypeByMetadataName(metadataName); 4314Assert.Null(((Compilation)comp).GetTypeByMetadataName("C")); 4334Assert.Null(comp.GetTypeByMetadataName($"<>F{checksum}__C")); 4337Assert.Null(comp.GetTypeByMetadataName($"<WrongName>F{checksum}__C")); 4340var sourceType = ((Compilation)comp).GetTypeByMetadataName($"<SomeFile>F{checksum}__C"); 4363Assert.Null(comp.GetTypeByMetadataName("C")); 4364Assert.Equal(member, comp.GetTypeByMetadataName(metadataName)); 4389Assert.Null(comp2.GetTypeByMetadataName("C")); 4390Assert.Equal(retargeted, comp2.GetTypeByMetadataName(metadataName)); 4420type = ((Compilation)referencingMetadataComp).GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C")!; 4429type = ((Compilation)referencingImageComp).GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C")!;
Symbols\Source\NullablePublicAPITests.cs (11)
146var c = ((Compilation)comp).GetTypeByMetadataName("C"); 213var c = ((Compilation)comp).GetTypeByMetadataName("C"); 287var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 376var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 479var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 487var e = ((Compilation)compilation).GetTypeByMetadataName("Ext"); 636var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 1211var aType = comp.GetTypeByMetadataName("A"); 1212var bType = comp.GetTypeByMetadataName("B"); 1213var cType = comp.GetTypeByMetadataName("C"); 1214var dType = comp.GetTypeByMetadataName("D");
Symbols\Source\PropertyTests.cs (6)
2616var ia = comp.GetTypeByMetadataName("IA"); 2634ia = comp.GetTypeByMetadataName("IA"); 2652ia = comp.GetTypeByMetadataName("IA"); 2670ia = comp.GetTypeByMetadataName("IA"); 2709ia = comp.GetTypeByMetadataName("IA"); 2727ia = comp.GetTypeByMetadataName("IA");
Symbols\Source\RecordTests.cs (2)
1126Assert.Equal(new[] { "C..ctor(System.Int32 X, System.Int32 Y)", "C..ctor(C original)" }, comp.GetTypeByMetadataName("C")!.Constructors.Select(m => m.ToTestDisplayString())); 1155Assert.Equal(new[] { "C..ctor(System.Int32 X, System.Int32 Y)", "C..ctor(C original)" }, comp.GetTypeByMetadataName("C")!.Constructors.Select(m => m.ToTestDisplayString()));
Symbols\Source\TypeMapTests.cs (2)
140var C1 = compilation.GetTypeByMetadataName("C1`2"); 182var C1 = compilation.GetTypeByMetadataName("C1`2");
Symbols\StaticAbstractMembersInInterfacesTests.cs (29)
149var i1 = compilation1.GetTypeByMetadataName("I1"); 860var i1 = compilation1.GetTypeByMetadataName("I1"); 988var i1 = compilation1.GetTypeByMetadataName("I1"); 1018var i1 = compilation1.GetTypeByMetadataName("I1"); 1060var i1 = compilation1.GetTypeByMetadataName("I1"); 1153var i1 = compilation1.GetTypeByMetadataName("I1"); 1190var i1 = compilation1.GetTypeByMetadataName("I1"); 1227var i1 = compilation1.GetTypeByMetadataName("I1"); 1274var i1 = compilation1.GetTypeByMetadataName("I1"); 1325var i1 = compilation1.GetTypeByMetadataName("I1"); 1380var i1 = compilation1.GetTypeByMetadataName("I1"); 1438var i1 = compilation1.GetTypeByMetadataName("I1"); 1493var i1 = compilation1.GetTypeByMetadataName("I1"); 1551var i1 = compilation1.GetTypeByMetadataName("I1"); 1731var i1 = compilation1.GetTypeByMetadataName("I1"); 2537var i1 = compilation1.GetTypeByMetadataName("I1"); 3370var i1 = compilation1.GetTypeByMetadataName("I1"); 4138foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I1").GetMembers()) 4151foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I2").GetMembers()) 4164foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I3").GetMembers()) 4384foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I1").GetMembers()) 4397foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I2").GetMembers()) 4410foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I3").GetMembers()) 4570foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I1").GetMembers()) 4583foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I2").GetMembers()) 4596foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I3").GetMembers()) 4810foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I1").GetMembers()) 4823foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I2").GetMembers()) 4836foreach (MethodSymbol m01 in compilation1.GetTypeByMetadataName("I3").GetMembers())
Symbols\TypeResolutionTests.cs (13)
54Assert.Null(c1.GetTypeByMetadataName("DoesntExist")); 55Assert.Null(c1.GetTypeByMetadataName("DoesntExist`1")); 56Assert.Null(c1.GetTypeByMetadataName("DoesntExist`2")); 58NamedTypeSymbol c1TestClass = c1.GetTypeByMetadataName("System.TestClass"); 60NamedTypeSymbol c1TestClassT = c1.GetTypeByMetadataName("System.TestClass`1"); 62Assert.Null(c1.GetTypeByMetadataName("System.TestClass`2")); 72NamedTypeSymbol c2TestClass = c2.GetTypeByMetadataName("System.TestClass"); 82NamedTypeSymbol c3TestClass = c3.GetTypeByMetadataName("System.TestClass"); 86Assert.Null(c3.GetTypeByMetadataName("System.TestClass`1")); 96NamedTypeSymbol c4TestClass = c4.GetTypeByMetadataName("System.TestClass"); 99Assert.Same(c1TestClassT, c4.GetTypeByMetadataName("System.TestClass`1")); 176Assert.Null(c3.GetTypeByMetadataName("A+B")); 186Assert.Equal("A.B", c1.GetTypeByMetadataName("A+B").ToTestDisplayString());
Symbols\TypeTests.cs (4)
1387var bar = comp.GetTypeByMetadataName("Bar"); 1388var iGooGetGoo = comp.GetTypeByMetadataName("Bar+IGoo").GetMembers("GetGoo").Single(); 2346var c = sourceComp.GetTypeByMetadataName("C").GetPublicSymbol(); 2394var c = metadataComp.GetTypeByMetadataName("C").GetPublicSymbol();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (15)
Parsing\ReadOnlyStructs.cs (13)
44var s1 = comp.GetTypeByMetadataName("Program+S1"); 50var s2 = comp.GetTypeByMetadataName("Program+S2"); 56var s3 = comp.GetTypeByMetadataName("Program+S3"); 118var s1 = comp.GetTypeByMetadataName("Program+S1"); 124var s2 = comp.GetTypeByMetadataName("Program+S2"); 130var s3 = comp.GetTypeByMetadataName("Program+S3"); 153var s1 = comp.GetTypeByMetadataName("Program+S1"); 159var s2 = comp.GetTypeByMetadataName("Program+S2"); 186var s1 = comp.GetTypeByMetadataName("Program+S1"); 190var s2 = comp.GetTypeByMetadataName("Program+S2"); 220var s1 = comp.GetTypeByMetadataName("Program+S1"); 224var s2 = comp.GetTypeByMetadataName("Program+S2"); 228var s3 = comp.GetTypeByMetadataName("Program+S3");
Parsing\RecordParsing.cs (2)
342Assert.Empty(comp.GetTypeByMetadataName("P").GetMembers()); 343Assert.Null(((SourceMemberContainerTypeSymbol)comp.GetTypeByMetadataName("P")).PrimaryConstructor);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (23)
CodeGeneration\SyntaxGeneratorTests.cs (23)
406var listType = _emptyCompilation.GetTypeByMetadataName("System.Collections.Generic.List`1"); 981var operatorSymbol = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMembers(WellKnownMemberNames.CheckedIncrementOperatorName).Single(); 988var gcHandleType = _emptyCompilation.GetTypeByMetadataName(typeof(GCHandle).FullName); 2156Generator.Declaration(_emptyCompilation.GetTypeByMetadataName("System.ComponentModel.INotifyPropertyChanged")), 2168_emptyCompilation.GetTypeByMetadataName("System.IntPtr").GetMembers("ToPointer").Single()), 2179_emptyCompilation.GetTypeByMetadataName("System.DateTimeKind")), 2193_emptyCompilation.GetTypeByMetadataName("System.Security.SecurityRuleSet")), 2209var type = compilation.GetTypeByMetadataName("D"); 2226var type = compilation.GetTypeByMetadataName("C"); 2247var type = compilation.GetTypeByMetadataName("C"); 2268var type = compilation.GetTypeByMetadataName("C"); 2289var type = compilation.GetTypeByMetadataName("C"); 2310var type = compilation.GetTypeByMetadataName("C"); 2332var type = compilation.GetTypeByMetadataName("C"); 2350var type = compilation.GetTypeByMetadataName("C"); 2373var type = compilation.GetTypeByMetadataName("B"); 2401var type = compilation.GetTypeByMetadataName("B"); 2429var type = compilation.GetTypeByMetadataName("B"); 2460var type = compilation.GetTypeByMetadataName("B"); 2494var type = compilation.GetTypeByMetadataName("Goo"); 2537var type = compilation.GetTypeByMetadataName("C"); 2560var type = compilation.GetTypeByMetadataName("C"); 2590var type = compilation.GetTypeByMetadataName("C");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (32)
CodeGeneration\CodeGenerationTests.cs (3)
674return arrayRank == 0 ? compilation.GetTypeByMetadataName(typeFullName) 675: compilation.CreateArrayTypeSymbol(compilation.GetTypeByMetadataName(typeFullName), arrayRank); 723=> s => s?.Compilation.GetTypeByMetadataName(typeMetadataName);
SymbolFinder\DependentTypeFinderTests.cs (29)
76var baseClassSymbol = portableCompilation.GetTypeByMetadataName("N.BaseClass"); 79var derivedClassSymbol = normalCompilation.GetTypeByMetadataName("M.DerivedClass"); 117var baseClassSymbol = portableCompilation.GetTypeByMetadataName("N.BaseInterface"); 120var derivedClassSymbol = normalCompilation.GetTypeByMetadataName("M.DerivedInterface"); 168var baseClassSymbol = portableCompilation.GetTypeByMetadataName("N.BaseClass"); 171var derivedClassSymbol = normalCompilation.GetTypeByMetadataName("M.DerivedClass"); 209var baseClassSymbol = portableCompilation.GetTypeByMetadataName("N.BaseClass"); 212var derivedClassSymbol = normalCompilation.GetTypeByMetadataName("M.DerivedClass"); 251var baseClassSymbol = portableCompilation.GetTypeByMetadataName("N.BaseClass"); 254var derivedClassSymbol = normalCompilation.GetTypeByMetadataName("M.DerivedClass"); 293var baseClassSymbol = portableCompilation.GetTypeByMetadataName("N.BaseClass"); 296var derivedClassSymbol = normalCompilation.GetTypeByMetadataName("M.DerivedClass"); 334var baseInterfaceSymbol = portableCompilation.GetTypeByMetadataName("N.IBaseInterface"); 337var implementingClassSymbol = normalCompilation.GetTypeByMetadataName("M.ImplementingClass"); 375var baseInterfaceSymbol = portableCompilation.GetTypeByMetadataName("N.IBaseInterface"); 378var implementingClassSymbol = normalCompilation.GetTypeByMetadataName("M.ImplementingClass"); 415var baseInterfaceSymbol = portableCompilation.GetTypeByMetadataName("N.IBaseInterface"); 418var implementingClassSymbol = normalCompilation.GetTypeByMetadataName("M.ImplementingClass"); 439var rootType = compilation.GetTypeByMetadataName("System.IO.Stream"); 484var rootType = compilation.GetTypeByMetadataName("IA"); 536var rootType = compilation.GetTypeByMetadataName("IA"); 573var rootType = compilation.GetTypeByMetadataName("System.ICloneable"); 603var rootType = compilation.GetTypeByMetadataName("System.IComparable"); 703var baseClass = compilation.GetTypeByMetadataName("N_Main.T_BaseProject_BaseClass"); 710var baseClass = compilation.GetTypeByMetadataName("N_Main.T_BaseProject_DerivedClass1"); 717var baseClass = compilation.GetTypeByMetadataName("N_Main.T_BaseProject_DerivedClass2"); 757var classSymbol = compilation2.GetTypeByMetadataName("M.C"); 760var interfaceSymbol = compilation1.GetTypeByMetadataName("N.I"); 788var baseInterfaceSymbol = portableCompilation.GetTypeByMetadataName("N.I");
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
95If namedType.AllInterfaces.Contains(context.Compilation.GetTypeByMetadataName("System.Runtime.Serialization.ISerializable")) Then
Rename\CSharp\SourceGeneratorTests.vb (1)
89Dim [interface] = context.Compilation.GetTypeByMetadataName("IInterface")
Microsoft.CodeAnalysis.Features (21)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
111.Contains(compilation.GetTypeByMetadataName("System.Diagnostics.DebuggerDisplayAttribute"));
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (2)
214return (compilation.GetTypeByMetadataName(fullyQualifiedName + aritySuffix), 0); 217return (compilation.GetTypeByMetadataName(fullyQualifiedName), 0);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
254if (collectionType.OriginalDefinition.Equals(model.Compilation.GetTypeByMetadataName(typeof(ImmutableArray<>).FullName!))) 273model.Compilation.GetTypeByMetadataName).Where(t => !IsNullOrErrorType(t));
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
344var wellKnownType = compilation.GetTypeByMetadataName($"{wellKnownNamespace}.{errorType.Name}");
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (2)
32var dateTimeType = compilation.GetTypeByMetadataName(typeof(DateTime).FullName!); 33var dateTimeOffsetType = compilation.GetTypeByMetadataName(typeof(DateTimeOffset).FullName!);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
36var regexType = compilation.GetTypeByMetadataName(typeof(Regex).FullName!);
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (2)
152var hashCodeType = compilation.GetTypeByMetadataName("System.HashCode"); 183var valueTupleType = compilation.GetTypeByMetadataName(typeof(ValueTuple).FullName!);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
141var equatableTypeOpt = semanticModel.Compilation.GetTypeByMetadataName(typeof(IEquatable<>).FullName!);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
541var typeSymbol = compilation.GetTypeByMetadataName(type.FullName!);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
605!parameter.Type.Equals(compilation.GetTypeByMetadataName(typeof(CancellationToken)?.FullName!));
SemanticSearch\AbstractSemanticSearchService.cs (1)
244? compilation.GetTypeByMetadataName(exceptionTypeName) is { } exceptionTypeSymbol
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
54var iCustomMarshaler = context.Compilation.GetTypeByMetadataName(typeof(ICustomMarshaler).FullName!);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
175=> semanticModel.Compilation.GetTypeByMetadataName(typeof(T).FullName!);
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
74enumerableType = compilation.GetTypeByMetadataName(typeof(Enumerable)?.FullName!);
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
109var nullableType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Nullable<>).FullName!);
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
73var formatProviderType = startContext.Compilation.GetTypeByMetadataName(typeof(System.IFormatProvider).FullName!);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
206var gcType = compilation.GetTypeByMetadataName(typeof(GC).FullName!);
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
179var typeSymbol = rebuildCompilation.GetTypeByMetadataName(mainTypeName);
Microsoft.CodeAnalysis.UnitTests (1)
Emit\SemanticEditTests.cs (1)
23var type = c.GetTypeByMetadataName("System.Object")!.GetPublicSymbol();
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (7)
Attributes\AssemblyAttributes.vb (6)
1306Assert.NotNull(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHere")) 1307Assert.NotNull(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHereM")) 1406Assert.Null(netmoduleCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHere")) 1407Assert.Null(netmoduleCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHereM")) 1423Assert.Null(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHere")) 1424Assert.Null(consoleappCompilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AssemblyAttributesGoHereM"))
Attributes\AttributeTests.vb (1)
1900Dim goo = comp.GetTypeByMetadataName("Goo")
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (28)
Compilation\CompilationAPITests.vb (23)
336Assert.Null(comp.GetTypeByMetadataName("`1")) 337Assert.Null(comp.GetTypeByMetadataName("中文`1")) 386Assert.Equal("D", comp.GetTypeByMetadataName("C+D").Name) 387Assert.Equal("E", comp.GetTypeByMetadataName("C+D+E").Name) 389Assert.Null(comp.GetTypeByMetadataName("")) 390Assert.Null(comp.GetTypeByMetadataName("+")) 391Assert.Null(comp.GetTypeByMetadataName("++")) 392Assert.Equal("C", comp.GetTypeByMetadataName("A.B.C").Name) 393Assert.Equal("D", comp.GetTypeByMetadataName("A.B.C+D").Name) 394Assert.Null(comp.GetTypeByMetadataName("A.B.C+F")) 395Assert.Equal("E", comp.GetTypeByMetadataName("A.B.C+D+E").Name) 396Assert.Null(comp.GetTypeByMetadataName("A.B.C+D+E+F")) 397Assert.Equal(1, comp.GetTypeByMetadataName("A.B.G`1").Arity) 398Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`1+Q`2").Arity) 399Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`2").Arity) 401Assert.Null(comp.GetTypeByMetadataName("c")) 402Assert.Null(comp.GetTypeByMetadataName("A.b.C")) 403Assert.Null(comp.GetTypeByMetadataName("C+d")) 405Assert.Equal(SpecialType.System_Array, comp.GetTypeByMetadataName("System.Array").SpecialType) 1438Assert.Null(c3.GetTypeByMetadataName("A+B")) 1447Assert.Equal("A.B", c1.GetTypeByMetadataName("A+B").ToDisplayString()) 2851Assert.Equal("corlibWithValueTupleRef", comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name) 2857Assert.Equal(expectedAssemblyName, comp.GetTypeByMetadataName("System.ValueTuple`2").ContainingAssembly.Name)
Compilation\ReferenceManagerTests.vb (2)
1655c.GetTypeByMetadataName("System.Int32").GetMembers() 1659Assert.Throws(Of ObjectDisposedException)(Function() c.GetTypeByMetadataName("System.Int64").GetMembers())
Semantics\InitOnlyMemberTests.vb (3)
5252Dim test1 = compilation.GetTypeByMetadataName("Test1`1") 5260Dim test1Constructed = compilation.GetTypeByMetadataName("Test2").BaseTypeNoUseSiteDiagnostics 5268Dim d = compilation.GetTypeByMetadataName("D")
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (36)
SymbolsTests\CorLibrary\CorTypes.vb (11)
229Assert.Null(c1.GetTypeByMetadataName("DoesntExist")) 230Assert.Null(c1.GetTypeByMetadataName("DoesntExist`1")) 231Assert.Null(c1.GetTypeByMetadataName("DoesntExist`2")) 233Dim c1TestClass As NamedTypeSymbol = c1.GetTypeByMetadataName("System.TestClass") 235Dim c1TestClassT As NamedTypeSymbol = c1.GetTypeByMetadataName("System.TestClass`1") 237Assert.Null(c1.GetTypeByMetadataName("System.TestClass`2")) 244Dim c2TestClass As NamedTypeSymbol = c2.GetTypeByMetadataName("System.TestClass") 251Dim c3TestClass As NamedTypeSymbol = c3.GetTypeByMetadataName("System.TestClass") 255Assert.Null(c3.GetTypeByMetadataName("System.TestClass`1")) 261Dim c4TestClass As NamedTypeSymbol = c4.GetTypeByMetadataName("System.TestClass") 264Assert.Same(c1TestClassT, c4.GetTypeByMetadataName("System.TestClass`1"))
SymbolsTests\Metadata\PE\NoPia.vb (2)
1283Dim i1F1 = compilationDerived.GetTypeByMetadataName("I1").GetMember(Of MethodSymbol)("F1") 1284Dim baseI1F1 = compilationDerived.GetTypeByMetadataName("Base").GetMember(Of MethodSymbol)("I1F1")
SymbolsTests\Metadata\PE\VisualBasicCompilerFeatureRequiredTests.vb (18)
160Dim onType = comp.GetTypeByMetadataName("OnType") 164Dim onMethod = comp.GetTypeByMetadataName("OnMethod") 168Dim onMethodReturn = comp.GetTypeByMetadataName("OnMethodReturn") 172Dim onParameter = comp.GetTypeByMetadataName("OnParameter") 178Dim onField = comp.GetTypeByMetadataName("OnField") 182Dim onProperty = comp.GetTypeByMetadataName("OnProperty") 186Dim onPropertyGetter = comp.GetTypeByMetadataName("OnPropertyGetter") 193Dim onPropertySetter = comp.GetTypeByMetadataName("OnPropertySetter") 200Dim onEvent = comp.GetTypeByMetadataName("OnEvent") 204Dim onEventAdder = comp.GetTypeByMetadataName("OnEventAdder") 211Dim onEventRemover = comp.GetTypeByMetadataName("OnEventRemover") 218Dim onEnum = comp.GetTypeByMetadataName("OnEnum") 221Dim onEnumMember = comp.GetTypeByMetadataName("OnEnumMember") 225Dim onClassTypeParameter = comp.GetTypeByMetadataName("OnClassTypeParameter`1") 229Dim onMethodTypeParameter = comp.GetTypeByMetadataName("OnMethodTypeParameter") 235Dim onDelegateType = comp.GetTypeByMetadataName("OnDelegateType") 238Dim onIndexedPropertyParameter = comp.GetTypeByMetadataName("OnIndexedPropertyParameter") 243Dim onThisParameterIndexer = comp.GetTypeByMetadataName("OnThisIndexerParameter")
SymbolsTests\ParamsCollectionTests.vb (2)
77Dim m1 = DirectCast(csCompilation, Compilation).GetTypeByMetadataName("C1").GetMembers().Where(Function(s) s.Name = "M1").Single() 78Dim m2 = DirectCast(csCompilation, Compilation).GetTypeByMetadataName("C1").GetMembers().Where(Function(s) s.Name = "M2").Single()
SymbolsTests\Source\OverridesTests.vb (1)
4240Dim derived = DirectCast(compilation.Compilation, VisualBasicCompilation).GetTypeByMetadataName("Derived")
SymbolsTests\WithStatementSymbolsTests.vb (2)
215Dim systemObject = compilation.GetTypeByMetadataName("System.Object") 261Dim systemObject = compilation.GetTypeByMetadataName("System.Object")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Utilities\IntrinsicOperators\AbstractIntrinsicOperatorDocumentation.vb (1)
53Dim returnType = semanticModel.Compilation.GetTypeByMetadataName(ReturnTypeMetadataName)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (12)
CodeGeneration\SyntaxGeneratorTests.vb (12)
369Dim listType = _emptyCompilation.GetTypeByMetadataName("System.Collections.Generic.List`1") 1065Dim gcHandleType = _emptyCompilation.GetTypeByMetadataName(GetType(GCHandle).FullName) 1093Dim additionOperatorSymbol = DirectCast(compilation.GetTypeByMetadataName("C").GetMembers(WellKnownMemberNames.AdditionOperatorName).Single(), IMethodSymbol) 2332Generator.Declaration(_emptyCompilation.GetTypeByMetadataName("System.ComponentModel.INotifyPropertyChanged")), 2342VerifySyntax(Of EnumBlockSyntax)(Generator.Declaration(_emptyCompilation.GetTypeByMetadataName("System.DateTimeKind")), 2352VerifySyntax(Of EnumBlockSyntax)(Generator.Declaration(_emptyCompilation.GetTypeByMetadataName("System.Security.SecurityRuleSet")), 2363Dim type = compilation.GetTypeByMetadataName("D") 2375Dim type = compilation.GetTypeByMetadataName("C") 2396Dim type = compilation.GetTypeByMetadataName("C") 2422Dim type = compilation.GetTypeByMetadataName("C") 2443Dim type = compilation.GetTypeByMetadataName("C") 2463Dim type = compilation.GetTypeByMetadataName("C")
Microsoft.CodeAnalysis.Workspaces (70)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
192var expressionSymbol = _context.SemanticModel.Compilation.GetTypeByMetadataName(typeof(Expression<>).FullName);
Shared\Utilities\EditorBrowsableHelpers.cs (2)
98var typeLibAttributeType = compilation.GetTypeByMetadataName(attributeMetadataName); 99var typeLibFlagsType = compilation.GetTypeByMetadataName(flagsMetadataName);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (63)
73=> compilation.GetTypeByMetadataName(typeof(Attribute).FullName!); 76=> compilation.GetTypeByMetadataName(typeof(Exception).FullName!); 79=> compilation.GetTypeByMetadataName(typeof(System.Diagnostics.DebuggerDisplayAttribute).FullName!); 82=> compilation.GetTypeByMetadataName(typeof(System.Runtime.InteropServices.StructLayoutAttribute).FullName!); 85=> compilation.GetTypeByMetadataName("System.ComponentModel.DesignerCategoryAttribute"); 88=> compilation.GetTypeByMetadataName("Microsoft.VisualBasic.CompilerServices.DesignerGeneratedAttribute"); 91=> compilation.GetTypeByMetadataName("Microsoft.VisualBasic.HideModuleNameAttribute"); 94=> compilation.GetTypeByMetadataName(typeof(ThreadStaticAttribute).FullName!); 97=> compilation.GetTypeByMetadataName(typeof(EventArgs).FullName!); 100=> compilation.GetTypeByMetadataName(typeof(NotImplementedException).FullName!); 103=> compilation.GetTypeByMetadataName(typeof(EqualityComparer<>).FullName!); 106=> compilation.GetTypeByMetadataName(typeof(Action).FullName!); 109=> compilation.GetTypeByMetadataName("System.Linq.Expressions.Expression`1"); 112=> compilation.GetTypeByMetadataName(typeof(EditorBrowsableAttribute).FullName!); 115=> compilation.GetTypeByMetadataName(typeof(EditorBrowsableState).FullName!); 118=> compilation.GetTypeByMetadataName(typeof(Task).FullName!); 121=> compilation.GetTypeByMetadataName(typeof(Task<>).FullName!); 124=> compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask"); 127=> compilation.GetTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); 130=> compilation.GetTypeByMetadataName(typeof(System.Collections.IEnumerable).FullName!); 133=> compilation.GetTypeByMetadataName(typeof(IEnumerable<>).FullName!); 136=> compilation.GetTypeByMetadataName(typeof(IEnumerator<>).FullName!); 139=> compilation.GetTypeByMetadataName(typeof(IList<>).FullName!); 142=> compilation.GetTypeByMetadataName(typeof(IReadOnlyList<>).FullName!); 145=> compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerable`1"); 148=> compilation.GetTypeByMetadataName("System.Collections.Generic.IAsyncEnumerator`1"); 151=> compilation.GetTypeByMetadataName(typeof(ImmutableArray<>).FullName!); 154=> compilation.GetTypeByMetadataName(typeof(SerializableAttribute).FullName!); 157=> compilation.GetTypeByMetadataName(typeof(CoClassAttribute).FullName!); 160=> compilation.GetTypeByMetadataName(typeof(ComAliasNameAttribute).FullName!); 163=> compilation.GetTypeByMetadataName(typeof(SuppressMessageAttribute).FullName!); 166=> compilation.GetTypeByMetadataName(typeof(TupleElementNamesAttribute).FullName!); 169=> compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.NativeIntegerAttribute"); 172=> compilation.GetTypeByMetadataName(typeof(DynamicAttribute).FullName!); 175=> compilation.GetTypeByMetadataName(typeof(Lazy<>).FullName!); 178=> compilation.GetTypeByMetadataName(typeof(ISerializable).FullName!); 181=> compilation.GetTypeByMetadataName(typeof(SerializationInfo).FullName!); 184=> compilation.GetTypeByMetadataName(typeof(StreamingContext).FullName!); 187=> compilation.GetTypeByMetadataName(typeof(OnDeserializingAttribute).FullName!); 190=> compilation.GetTypeByMetadataName(typeof(OnDeserializedAttribute).FullName!); 193=> compilation.GetTypeByMetadataName(typeof(OnSerializingAttribute).FullName!); 196=> compilation.GetTypeByMetadataName(typeof(OnSerializedAttribute).FullName!); 199=> compilation.GetTypeByMetadataName(typeof(ComRegisterFunctionAttribute).FullName!); 202=> compilation.GetTypeByMetadataName(typeof(ComUnregisterFunctionAttribute).FullName!); 205=> compilation.GetTypeByMetadataName(typeof(ConditionalAttribute).FullName!); 208=> compilation.GetTypeByMetadataName(typeof(ObsoleteAttribute).FullName!); 211=> compilation.GetTypeByMetadataName("System.Composition.ImportingConstructorAttribute"); 214=> compilation.GetTypeByMetadataName("System.ComponentModel.Composition.ImportingConstructorAttribute"); 217=> compilation.GetTypeByMetadataName(typeof(IDisposable).FullName!); 220=> compilation.GetTypeByMetadataName(typeof(NotNullAttribute).FullName!); 223=> compilation.GetTypeByMetadataName(typeof(MaybeNullAttribute).FullName!); 226=> compilation.GetTypeByMetadataName(typeof(MaybeNullWhenAttribute).FullName!); 229=> compilation.GetTypeByMetadataName(typeof(AllowNullAttribute).FullName!); 232=> compilation.GetTypeByMetadataName(typeof(DisallowNullAttribute).FullName!); 235=> compilation.GetTypeByMetadataName(typeof(DataMemberAttribute).FullName!); 238=> compilation.GetTypeByMetadataName(typeof(DataContractAttribute).FullName!); 241=> compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.AsyncMethodBuilderAttribute"); 244=> compilation.GetTypeByMetadataName(typeof(CancellationToken).FullName!); 247=> compilation.GetTypeByMetadataName($"System.ValueTuple`{arity}"); 250=> compilation.GetTypeByMetadataName(typeof(List<>).FullName!); 253=> compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName!); 256=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!); 259=> compilation.GetTypeByMetadataName(typeof(InterpolatedStringHandlerAttribute).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
441var delegateType = compilation.GetTypeByMetadataName(method.ReturnsVoid
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
421var type = compilation.GetTypeByMetadataName(typeof(ArgumentNullException).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
223var iequatableType = compilation.GetTypeByMetadataName(typeof(IEquatable<>).FullName);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
487compilationWithoutGeneratedDocuments.GetTypeByMetadataName("System.Object") != null);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (5)
VisualStudioMSBuildWorkspaceTests.cs (5)
2537var symbol = comp.GetTypeByMetadataName("System.Console"); 2555var symbol = comp.GetTypeByMetadataName("CSharpProject.CSharpClass"); 2573var symbol = comp.GetTypeByMetadataName("VisualBasicProject.VisualBasicClass"); 2591var cssymbol = cscomp.GetTypeByMetadataName("CSharpProject.CSharpClass"); 2599var vbsymbol = vbcomp.GetTypeByMetadataName("VisualBasicProject.VisualBasicClass");
Microsoft.CodeAnalysis.Workspaces.UnitTests (29)
FindReferencesTests.cs (13)
104var symbol = (await project.GetCompilationAsync()).GetTypeByMetadataName("C").GetMembers("X").First(); 129var symbol = (IFieldSymbol)(await project.GetCompilationAsync()).GetTypeByMetadataName("C").GetMembers("X").First(); 327var typeB = comp.GetTypeByMetadataName("B"); 338var typeC = comp.GetTypeByMetadataName("C"); 349var typeA = comp.GetTypeByMetadataName("A"); 391var interfaceMethod = (IMethodSymbol)(await netStandardProject.GetCompilationAsync()).GetTypeByMetadataName("N.I").GetMembers("Get").First(); 437var nameProperty = compilation.GetTypeByMetadataName("A.C").GetMembers("Uri").Single(); 480var baseType = portableCompilation.GetTypeByMetadataName("N.BaseClass"); 484var derivedType = normalCompilation.GetTypeByMetadataName("M.DerivedClass"); 516var constraint = comp.GetTypeByMetadataName("C`1").TypeParameters.Single().ConstraintTypes.Single(); 542var symbol = compilation.GetTypeByMetadataName("C"); 575var symbol = compilation.GetTypeByMetadataName("C"); 617var symbol = compilation.GetTypeByMetadataName("Test.Dummy+NestedDummy");
SolutionTests\SolutionTests.cs (2)
3973var classC = comp3.GetTypeByMetadataName("C"); 3981classC = comp3.GetTypeByMetadataName("C");
UtilityTest\DocumentationCommentIdTests.cs (13)
85CheckDeclarationId("T:Color", compilation.GetTypeByMetadataName("Color"), compilation); 86CheckDeclarationId("T:Acme.IProcess", compilation.GetTypeByMetadataName("Acme.IProcess"), compilation); 87CheckDeclarationId("T:Acme.ValueType", compilation.GetTypeByMetadataName("Acme.ValueType"), compilation); 88CheckDeclarationId("T:Acme.Widget", compilation.GetTypeByMetadataName("Acme.Widget"), compilation); 89CheckDeclarationId("T:Acme.Widget.NestedClass", compilation.GetTypeByMetadataName("Acme.Widget+NestedClass"), compilation); 90CheckDeclarationId("T:Acme.Widget.IMenuItem", compilation.GetTypeByMetadataName("Acme.Widget+IMenuItem"), compilation); 91CheckDeclarationId("T:Acme.Widget.Del", compilation.GetTypeByMetadataName("Acme.Widget+Del"), compilation); 92CheckDeclarationId("T:Acme.Widget.Direction", compilation.GetTypeByMetadataName("Acme.Widget+Direction"), compilation); 93CheckDeclarationId("T:Acme.MyList`1", compilation.GetTypeByMetadataName("Acme.MyList`1"), compilation); 94CheckDeclarationId("T:Acme.MyList`1.Helper`2", compilation.GetTypeByMetadataName("Acme.MyList`1+Helper`2"), compilation); 335var outerType = compilation.GetTypeByMetadataName("Acme.OuterType`1"); 336var innerType = compilation.GetTypeByMetadataName("Acme.OuterType`1+InnerType`2"); 338var ienum = compilation.GetTypeByMetadataName("System.Collections.Generic.IEnumerable`1");
UtilityTest\XmlDocumentationProviderTests.cs (1)
41var xml = compilation.GetTypeByMetadataName("Microsoft.CodeAnalysis.AdditionalTextFile")!.GetDocumentationCommentXml();
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\ResourceUsageAnalyzer.cs (1)
27SRSymbol = context.Compilation.GetTypeByMetadataName("System.SR");
Microsoft.Extensions.Logging.Generators (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
Microsoft.Extensions.Options.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
SymbolLoader.cs (1)
30INamedTypeSymbol? GetSymbol(string metadataName) => compilation.GetTypeByMetadataName(metadataName);
Microsoft.Gen.ComplianceReports (2)
SymbolLoader.cs (2)
16var dataClassificationAttributeSymbol = compilation.GetTypeByMetadataName(DataClassificationAttribute); 26compilation.GetTypeByMetadataName(LoggerMessageAttribute));
Microsoft.Gen.ContextualOptions (1)
SymbolLoader.cs (1)
14var optionsContextAttribute = compilation.GetTypeByMetadataName("Microsoft.Extensions.Options.Contextual.OptionsContextAttribute");
Microsoft.Gen.Logging (1)
src\Generators\Shared\RoslynExtensions.cs (1)
47var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
Microsoft.Gen.Metrics (8)
src\Generators\Shared\RoslynExtensions.cs (1)
47var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
SymbolLoader.cs (7)
20var meterClassSymbol = compilation.GetTypeByMetadataName(MeterClass); 21var counterAttribute = compilation.GetTypeByMetadataName(CounterAttribute); 22var histogramAttribute = compilation.GetTypeByMetadataName(HistogramAttribute); 32var counterTAttribute = compilation.GetTypeByMetadataName(CounterTAttribute); 33var histogramTAttribute = compilation.GetTypeByMetadataName(HistogramTAttribute); 34var gaugeAttribute = compilation.GetTypeByMetadataName(GaugeAttribute); 35var tagNameAttribute = compilation.GetTypeByMetadataName(TagNameAttribute);
Microsoft.Gen.MetricsReports (7)
src\Generators\Microsoft.Gen.Metrics\SymbolLoader.cs (7)
20var meterClassSymbol = compilation.GetTypeByMetadataName(MeterClass); 21var counterAttribute = compilation.GetTypeByMetadataName(CounterAttribute); 22var histogramAttribute = compilation.GetTypeByMetadataName(HistogramAttribute); 32var counterTAttribute = compilation.GetTypeByMetadataName(CounterTAttribute); 33var histogramTAttribute = compilation.GetTypeByMetadataName(HistogramTAttribute); 34var gaugeAttribute = compilation.GetTypeByMetadataName(GaugeAttribute); 35var tagNameAttribute = compilation.GetTypeByMetadataName(TagNameAttribute);
Microsoft.Interop.ComInterfaceGenerator (9)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
78var generatedComInterfaceAttribute = gen.Attribute(gen.TypeExpression(comp.GetTypeByMetadataName(TypeNames.GeneratedComInterfaceAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 87gen.AttributeArgument("StringMarshallingCustomType", gen.TypeOfExpression(gen.TypeExpression(comp.GetTypeByMetadataName(TypeNames.BStrStringMarshaller)))) 97var comImportAttributeType = comp.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_ComImportAttribute);
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
VtableIndexStubGenerator.cs (5)
201INamedTypeSymbol? lcidConversionAttrType = environment.Compilation.GetTypeByMetadataName(TypeNames.LCIDConversionAttribute); 202INamedTypeSymbol? suppressGCTransitionAttrType = environment.Compilation.GetTypeByMetadataName(TypeNames.SuppressGCTransitionAttribute); 203INamedTypeSymbol? unmanagedCallConvAttrType = environment.Compilation.GetTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute); 204INamedTypeSymbol iUnmanagedInterfaceTypeType = environment.Compilation.GetTypeByMetadataName(TypeNames.IUnmanagedInterfaceType_Metadata)!; 353compilation.GetTypeByMetadataName(TypeNames.System_Exception),
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSMarshalAsAttributeInfoParser.cs (1)
19_jsMarshalAsAttribute = compilation.GetTypeByMetadataName(Constants.JSMarshalAsAttribute)!.ConstructUnboundGenericType();
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
571compilation.GetTypeByMetadataName("System.NotImplementedException"))));
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
Microsoft.Interop.SourceGeneration (15)
ArrayMarshallingInfoProvider.cs (2)
51arrayMarshaller = compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_PointerArrayMarshaller_Metadata); 56arrayMarshaller = compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_ArrayMarshaller_Metadata);
ComInterfaceMarshallingInfoProvider.cs (1)
35INamedTypeSymbol? comInterfaceMarshaller = compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_Marshalling_ComInterfaceMarshaller_Metadata);
MarshallerShape.cs (4)
116INamedTypeSymbol spanOfT = compilation.GetTypeByMetadataName(TypeNames.System_Span_Metadata)!; 120INamedTypeSymbol readOnlySpanOfT = compilation.GetTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!; 454INamedTypeSymbol spanOfT = compilation.GetTypeByMetadataName(TypeNames.System_Span_Metadata)!; 459INamedTypeSymbol readOnlySpanOfT = compilation.GetTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!;
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
StubEnvironment.cs (5)
30_lcidConversionAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.LCIDConversionAttribute)); 44_suppressGCTransitionAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.SuppressGCTransitionAttribute)); 58_unmanagedCallConvAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute)); 72_defaultDllImportSearchPathsAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.DefaultDllImportSearchPathsAttribute)); 86_wasmImportLinkageAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.WasmImportLinkageAttribute));
TypePositionInfo.cs (2)
118INamedTypeSymbol outAttributeType = compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_OutAttribute)!; 119INamedTypeSymbol inAttributeType = compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_InAttribute)!;
Microsoft.ML.InternalCodeAnalyzer (7)
BaseTestClassAnalyzer.cs (3)
40if (!(context.Compilation.GetTypeByMetadataName("Xunit.FactAttribute") is { } factAttribute)) 61_baseTestClass = _compilation.GetTypeByMetadataName("Microsoft.ML.TestFramework.BaseTestClass"); 62_ITbaseTestClass = _compilation.GetTypeByMetadataName("Microsoft.ML.IntegrationTests.IntegrationTestBaseClass");
BestFriendAnalyzer.cs (2)
55var bestFriendAttributeType = comp.GetTypeByMetadataName(attributeName); 58var wantsToBeBestFriendsAttributeType = comp.GetTypeByMetadataName(assemblyAttributeName);
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
48var attribute = context.Compilation.GetTypeByMetadataName(attributeName);
RelaxTestNamingSuppressor.cs (1)
26if (!(context.Compilation.GetTypeByMetadataName("Xunit.FactAttribute") is { } factAttribute))
Microsoft.VisualStudio.LanguageServices (9)
Venus\ContainedLanguageCodeSupport.cs (9)
47var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 60var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 91var type = compilation.GetTypeByMetadataName(className); 159var type = thisCompilation.GetTypeByMetadataName(className); 261var type = thisDocument.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 294var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 417return document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(fullyQualifiedName); 423var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(typeName); 484var objectType = compilation.GetTypeByMetadataName(objectTypeName);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
3022ITypeSymbol? typeSymbol = compilation.GetTypeByMetadataName(fullName);
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
3628Dim typeSymbol As ITypeSymbol = compilation.GetTypeByMetadataName(fullName)
Mvc.Analyzers.Test (60)
CodeAnalysisExtensionsTest.cs (52)
25var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 26var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 53var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 54var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 90var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 91var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 127var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 128var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 164var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 165var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 209var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 210var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 252var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); 253var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 279var attribute = compilation.GetTypeByMetadataName(typeof(ApiConventionTypeAttribute).FullName); 280var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 306var attribute = compilation.GetTypeByMetadataName(typeof(ApiConventionTypeAttribute).FullName); 307var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 349var attribute = compilation.GetTypeByMetadataName(typeof(ApiConventionTypeAttribute).FullName); 350var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 397var attribute = compilation.GetTypeByMetadataName(typeof(ApiConventionTypeAttribute).FullName); 398var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 435var attribute = compilation.GetTypeByMetadataName(typeof(ApiConventionTypeAttribute).FullName); 436var testClass = compilation.GetTypeByMetadataName("TestApp.TestClass"); 473var attribute = compilation.GetTypeByMetadataName("TestApp.HasAttribute_ReturnsFalseIfTypeDoesNotHaveAttribute"); 474var testClass = compilation.GetTypeByMetadataName("TestApp.HasAttribute_ReturnsFalseIfTypeDoesNotHaveAttributeTest"); 503var attribute = compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Mvc.ControllerAttribute"); 504var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 529var attribute = compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Mvc.ControllerAttribute"); 530var testClass = compilation.GetTypeByMetadataName($"TestApp.TestController"); 560var @interface = compilation.GetTypeByMetadataName("TestApp.ITestInterface"); 561var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 590var attribute = compilation.GetTypeByMetadataName("TestApp.TestAttribute"); 591var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 624var attribute = compilation.GetTypeByMetadataName("TestApp.TestAttribute"); 625var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 655var attribute = compilation.GetTypeByMetadataName("TestApp.TestAttribute"); 656var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 689var attribute = compilation.GetTypeByMetadataName("TestApp.TestAttribute"); 690var testClass = compilation.GetTypeByMetadataName("TestApp.TestController"); 715var sourceType = compilation.GetTypeByMetadataName("TestApp.TypeA"); 716var target = compilation.GetTypeByMetadataName("TestApp.TypeB"); 736var sourceType = compilation.GetTypeByMetadataName("TestApp.TypeA"); 737var target = compilation.GetTypeByMetadataName("System.IDisposable"); 757var sourceType = compilation.GetTypeByMetadataName("TestApp.TestType"); 758var target = compilation.GetTypeByMetadataName("TestApp.TestType"); 782var sourceType = compilation.GetTypeByMetadataName("TestApp.ITestInterface"); 783var target = compilation.GetTypeByMetadataName("TestApp.TestType"); 805var sourceType = compilation.GetTypeByMetadataName("TestApp.ITestInterface"); 806var target = compilation.GetTypeByMetadataName("TestApp.ITestInterface"); 838var sourceType = compilation.GetTypeByMetadataName("TestApp.ITestInterface"); 839var target = compilation.GetTypeByMetadataName("TestApp.TestClass");
TopLevelParameterNameAnalyzerTest.cs (8)
321var modelType = compilation.GetTypeByMetadataName("Microsoft.AspNetCore.Mvc.Analyzers.TopLevelParameterNameAnalyzerTestFiles.TestController"); 436var type = compilation.GetTypeByMetadataName("TestApp.GetNameTests"); 461var type = compilation.GetTypeByMetadataName("TestApp.GetNameTests"); 485var type = compilation.GetTypeByMetadataName("TestApp.GetNameTests"); 509var type = compilation.GetTypeByMetadataName("TestApp.GetNameTests"); 533var type = compilation.GetTypeByMetadataName("TestApp.SpecifiesModelTypeTests"); 556var type = compilation.GetTypeByMetadataName("TestApp.SpecifiesModelTypeTests"); 579var type = compilation.GetTypeByMetadataName("TestApp.SpecifiesModelTypeTests");
Mvc.Api.Analyzers.Test (64)
ActualApiResponseMetadataFactoryTest.cs (6)
28var attribute = compilation.GetTypeByMetadataName(typeof(TestActionResultUsingStatusCodesConstants).FullName).GetAttributes()[0]; 42var attribute = compilation.GetTypeByMetadataName(typeof(TestActionResultUsingHttpStatusCodeCast).FullName).GetAttributes()[0]; 73var returnType = compilation.GetTypeByMetadataName($"{Namespace}.TestController"); 369var type = compilation.GetTypeByMetadataName(typeName); 390var controllerType = compilation.GetTypeByMetadataName(controllerTypeName); 409var returnType = compilation.GetTypeByMetadataName($"{Namespace}.{test}");
ApiControllerFactsTest.cs (6)
37var method = (IMethodSymbol)compilation.GetTypeByMetadataName("TestNamespace.TestController").GetMembers("Get").First(); 52var type = compilation.GetTypeByMetadataName(typeof(ApiConventionAnalyzerTest_IndexModel).FullName); 68var type = compilation.GetTypeByMetadataName(typeof(ApiConventionAnalyzerTest_NotApiController).FullName); 84var type = compilation.GetTypeByMetadataName(typeof(ApiConventionAnalyzerTest_NotAction).FullName); 100var type = compilation.GetTypeByMetadataName(typeof(ApiConventionAnalyzerTest_Valid).FullName); 116var type = compilation.GetTypeByMetadataName(typeof(IsApiControllerAction_ReturnsTrue_IfAttributeIsDeclaredOnAssemblyController).FullName);
MvcFactsTest.cs (12)
66var controllerAttribute = compilation.GetTypeByMetadataName(ControllerAttribute); 67var nonControllerAttribute = compilation.GetTypeByMetadataName(NonControllerAttribute); 68var typeSymbol = compilation.GetTypeByMetadataName(type.FullName); 80var controllerAttribute = compilation.GetTypeByMetadataName(ControllerAttribute); 81var nonControllerAttribute = compilation.GetTypeByMetadataName(NonControllerAttribute); 82var typeSymbol = compilation.GetTypeByMetadataName(type.FullName); 150var nonActionAttribute = compilation.GetTypeByMetadataName(NonActionAttribute); 152var typeSymbol = compilation.GetTypeByMetadataName(type.FullName); 182var nonActionAttribute = compilation.GetTypeByMetadataName(NonActionAttribute); 184var typeSymbol = compilation.GetTypeByMetadataName(typeof(NotDisposableWithDisposeThatIsNotInterfaceContract).FullName); 197var nonActionAttribute = compilation.GetTypeByMetadataName(NonActionAttribute); 199var typeSymbol = compilation.GetTypeByMetadataName(type.FullName);
SymbolApiConventionMatcherTest.cs (17)
274var typeSymbol = compilation.GetTypeByMetadataName(type.FullName); 275var conventionTypeSymbol = compilation.GetTypeByMetadataName(conventionType.FullName); 290var type = compilation.GetTypeByMetadataName(BaseTypeName); 291var conventionType = compilation.GetTypeByMetadataName(BaseTypeName); 306var type = compilation.GetTypeByMetadataName(DerivedTypeName); 307var conventionType = compilation.GetTypeByMetadataName(BaseTypeName); 322var type = compilation.GetTypeByMetadataName(BaseTypeName); 323var conventionType = compilation.GetTypeByMetadataName(DerivedTypeName); 339var conventionType = compilation.GetTypeByMetadataName(BaseTypeName); 430var testController = compilation.GetTypeByMetadataName(TestControllerName); 431var testConvention = compilation.GetTypeByMetadataName(TestConventionName); 450var testConvention = compilation.GetTypeByMetadataName(TestConventionName); 468var testConvention = compilation.GetTypeByMetadataName(TestConventionName); 486var testConvention = compilation.GetTypeByMetadataName(TestConventionName); 504var testConvention = compilation.GetTypeByMetadataName(TestConventionName); 523var testConvention = compilation.GetTypeByMetadataName(TestConventionName); 542var testConvention = compilation.GetTypeByMetadataName(TestConventionName);
SymbolApiResponseMetadataProviderTest.cs (23)
18var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerWithoutConvention)}"); 36var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerWithoutConvention)}"); 54var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 72var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 95var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 118var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 141var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 164var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 186var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 217var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 239var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 272var controller = compilation.GetTypeByMetadataName($"{Namespace}.{typeName}"); 295var controller = compilation.GetTypeByMetadataName(type.FullName); 317var controller = compilation.GetTypeByMetadataName(type.FullName); 391var controller = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetResponseMetadata_ControllerActionWithAttributes)}"); 405var expected = compilation.GetTypeByMetadataName(typeof(ProblemDetails).FullName); 407var type = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsProblemDetails_IfNoAttributeIsDiscoveredController).FullName); 423var expected = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsTypeDefinedAtAssemblyModel).FullName); 425var type = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsTypeDefinedAtAssemblyController).FullName); 441var expected = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsTypeDefinedAtControllerModel).FullName); 443var type = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsTypeDefinedAtControllerController).FullName); 459var expected = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsTypeDefinedAtActionModel).FullName); 461var type = compilation.GetTypeByMetadataName(typeof(GetErrorResponseType_ReturnsTypeDefinedAtActionController).FullName);
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
System.Text.RegularExpressions.Generator (5)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
41var type = compilation.GetTypeByMetadataName(fullyQualifiedMetadataName);
UpgradeToGeneratedRegexAnalyzer.cs (2)
233regexTypeSymbol = compilation.GetTypeByMetadataName(RegexTypeName); 239INamedTypeSymbol? generatedRegexAttributeTypeSymbol = compilation.GetTypeByMetadataName(GeneratedRegexTypeName);
UpgradeToGeneratedRegexCodeFixer.cs (2)
86INamedTypeSymbol? regexSymbol = compilation.GetTypeByMetadataName(RegexTypeName); 87INamedTypeSymbol? generatedRegexAttributeSymbol = compilation.GetTypeByMetadataName(GeneratedRegexTypeName);
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
205INamedTypeSymbol? flagsAttributeType = compilation.GetTypeByMetadataName("System.FlagsAttribute");