5 implementations of Construct
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationAbstractNamedTypeSymbol.cs (1)
58public INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments)
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\NamedTypeSymbol.cs (1)
131INamedTypeSymbol INamedTypeSymbol.Construct(params ITypeSymbol[] typeArguments)
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
91public INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamedTypeSymbol.vb (1)
1176Private Function INamedTypeSymbol_Construct(ParamArray typeArguments() As ITypeSymbol) As INamedTypeSymbol Implements INamedTypeSymbol.Construct
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationAbstractNamedTypeSymbol.cs (1)
58public INamedTypeSymbol Construct(params ITypeSymbol[] typeArguments)
145 references to Construct
Microsoft.CodeAnalysis (2)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
648typeSymbol = typeSymbol.Construct(typeArguments.Select(t => t.Type).ToArray());
DocumentationCommentId.cs (1)
1010results[i] = ((INamedTypeSymbol)results[i]).Construct(typeArgs);
Microsoft.CodeAnalysis.CodeStyle (4)
INamedTypeSymbolExtensions.cs (1)
621=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
648typeSymbol = typeSymbol.Construct(typeArguments.Select(t => t.Type).ToArray());
SymbolKey.ErrorTypeSymbolKey.cs (1)
99var errorType = typeArgumentsArray != null ? originalType.Construct(typeArgumentsArray) : originalType;
SymbolKey.NamedTypeSymbolKey.cs (1)
191var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
SyntaxGeneratorExtensions.cs (1)
67: generatorInternal.Type(equalityComparerType.Construct(type), typeContext: false);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
ConvertToRecordHelpers.cs (1)
70var equatable = compilation.GetBestTypeByMetadataName("System.IEquatable`1")?.Construct(containingType);
CSharpAddYieldCodeFixProvider.cs (2)
135ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(typeArgument); 136ienumeratorGenericSymbol = ienumeratorGenericSymbol.Construct(typeArgument);
CSharpChangeToIEnumerableCodeFixProvider.cs (3)
64ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(typeArg); 68ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(arrayType.ElementType); 77ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(type);
CSharpFixReturnTypeCodeFixProvider.cs (2)
120fixedDeclaration = taskType.Construct(returnedType).GenerateTypeSyntax(allowVar: false); 185return baseTupleType.Construct(inferredTupleTypes);
CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
134: knownTypes.IAsyncEnumerableOfTTypeOpt.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax(); 140: knownTypes.IAsyncEnumeratorOfTTypeOpt.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax(); 150newReturnType = knownTypes.TaskOfTType!.Construct(methodSymbol.ReturnType).GenerateTypeSyntax();
CSharpMakeMethodSynchronousCodeFixProvider.cs (2)
77newReturnType = knownTypes.IEnumerableOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax(); 83newReturnType = knownTypes.IEnumeratorOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax();
CSharpTypeInferenceService.TypeInferrer.cs (6)
1162return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(symbol); 1288.Construct(Compilation.GetSpecialType(SpecialType.System_Object))); 1291return variableTypes.Select(v => new TypeInferenceInfo(enumerableType.Construct(v.InferredType))); 1779return CreateResult(taskOfT.Construct(this.Compilation.ObjectType)); 1809return CreateResult(ienumerableType.Construct(typeArg)); 2019return types.Select(t => t.InferredType.SpecialType == SpecialType.System_Void ? new TypeInferenceInfo(task) : new TypeInferenceInfo(taskOfT.Construct(t.InferredType)));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (16)
CodeGen\CodeGenTupleTest.cs (16)
6206var vt2 = comp.CreateErrorTypeSymbol(null, "ValueTuple", 2).Construct(intType, intType); 6250vt2 = comp.CreateErrorTypeSymbol(comp.CreateErrorNamespaceSymbol(comp.GlobalNamespace, "System"), "ValueTuple", 2).Construct(intType, intType); 6253vt2 = comp.CreateErrorTypeSymbol(comp.CreateErrorNamespaceSymbol(comp.Assembly.GlobalNamespace, "System"), "ValueTuple", 2).Construct(intType, intType); 6256vt2 = comp.CreateErrorTypeSymbol(comp.CreateErrorNamespaceSymbol(comp.SourceModule.GlobalNamespace, "System"), "ValueTuple", 2).Construct(intType, intType); 6600var twoStrings = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(stringType, stringType); 6602var tuple2Underlying = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest).Construct(intType, intType, intType, intType, intType, intType, intType, twoStringsWithNames); 18870var int_string1 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 18894var int_int1 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, intType); 18934var int_string2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 18935var int_object2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, objectType); 19153var int_string1 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 19154var int_object = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, objectType); 19155var int_object_object = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T3).Construct(intType, objectType, objectType); 19192var int_string1 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 19193var int_object = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, objectType); 19194var int_object_object = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T3).Construct(intType, objectType, objectType);
Microsoft.CodeAnalysis.CSharp.Features (13)
ConvertToRecordHelpers.cs (1)
70var equatable = compilation.GetBestTypeByMetadataName("System.IEquatable`1")?.Construct(containingType);
CSharpAddYieldCodeFixProvider.cs (2)
135ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(typeArgument); 136ienumeratorGenericSymbol = ienumeratorGenericSymbol.Construct(typeArgument);
CSharpChangeToIEnumerableCodeFixProvider.cs (3)
64ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(typeArg); 68ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(arrayType.ElementType); 77ienumerableGenericSymbol = ienumerableGenericSymbol.Construct(type);
CSharpFixReturnTypeCodeFixProvider.cs (2)
120fixedDeclaration = taskType.Construct(returnedType).GenerateTypeSyntax(allowVar: false); 185return baseTupleType.Construct(inferredTupleTypes);
CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
134: knownTypes.IAsyncEnumerableOfTTypeOpt.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax(); 140: knownTypes.IAsyncEnumeratorOfTTypeOpt.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax(); 150newReturnType = knownTypes.TaskOfTType!.Construct(methodSymbol.ReturnType).GenerateTypeSyntax();
CSharpMakeMethodSynchronousCodeFixProvider.cs (2)
77newReturnType = knownTypes.IEnumerableOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax(); 83newReturnType = knownTypes.IEnumeratorOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (33)
Compilation\CompilationAPITests.cs (2)
2791var nullableIntType = compilation.GetSpecialType(SpecialType.System_Nullable_T).GetPublicSymbol().Construct(intType); 2981var nullableIntType = compilation.GetSpecialType(SpecialType.System_Nullable_T).GetPublicSymbol().Construct(intType);
Compilation\GetSemanticInfoTests.cs (17)
5408Assert.Throws<InvalidOperationException>(() => type.Construct(objectType)); // non-generic type 5414Assert.Throws<InvalidOperationException>(() => type.Construct(objectType)); // non-generic type 5420Assert.Throws<ArgumentException>(() => type.Construct(new ITypeSymbol[] { null })); // null type arg 5421Assert.Throws<ArgumentException>(() => type.Construct()); // typeArgs.Length != Arity 5422Assert.Throws<InvalidOperationException>(() => type.Construct(objectType).Construct(objectType)); // constructed type 5428Assert.Throws<ArgumentException>(() => type.Construct(new ITypeSymbol[] { null })); // null type arg 5429Assert.Throws<ArgumentException>(() => type.Construct()); // typeArgs.Length != Arity 5430Assert.Throws<InvalidOperationException>(() => type.Construct(objectType).Construct(objectType)); // constructed type 5523var otherFuncType = comp.GetWellKnownType(WellKnownType.System_Func_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 5537var otherFuncType = comp.GetWellKnownType(WellKnownType.System_Func_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 5623var typeFuncB = comp.GetWellKnownType(WellKnownType.System_Func_T).Construct(typeB); 5670var typeFuncC = comp.GetWellKnownType(WellKnownType.System_Func_T).Construct(typeC); 5729var typeFuncA = typeFunc.Construct(typeInt, typeA); 5730var typeFuncB = typeFunc.Construct(typeInt, typeB); 5731var typeFuncC = typeFunc.Construct(typeInt, typeC);
Compilation\SemanticModelAPITests.cs (3)
3746var actionType = comp.GetWellKnownType(WellKnownType.System_Action_T).Construct(stringType); 3923var type1 = comp.GetSpecialType(SpecialType.System_Nullable_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 3930var type2 = comp.GetSpecialType(SpecialType.System_Nullable_T).Construct(comp.GetSpecialType(SpecialType.System_Int32));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
1824type = type.Construct(compilation.GetSpecialType(SpecialType.System_String));
Compilation\TypeInfoTests.cs (2)
45var intEnum1 = c.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).GetPublicSymbol().Construct(int32); 46var intEnum2 = c.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).GetPublicSymbol().Construct(int32);
DocumentationComments\CrefTests.cs (4)
3053Assert.Equal(typeA.Construct(actualL), actualParameterTypes[4]); 3054Assert.Equal(typeA.Construct(typeInt).GetMember<INamedTypeSymbol>("B").Construct(actualK), actualParameterTypes[5]); 6148var expectedParameterTypeSymbol = classA.Construct(classB).GetMember<INamedTypeSymbol>("B");
Symbols\AnonymousTypesSemanticsTests.cs (1)
1893Assert.Throws<InvalidOperationException>(() => namedType.Construct(args));
Symbols\ConversionTests.cs (1)
1720var destinationType = comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C").Construct(comp.GetSpecialType(SpecialType.System_Int32));
Symbols\CustomModifiersTests.cs (2)
82nullable = nullable.Construct(i); 155dictionary = dictionary.Construct(i, i);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
757return definition.Construct(typeArguments.Select(s => s.GetPublicSymbol()).ToArray());
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CSharpTypeInferenceService.TypeInferrer.cs (6)
1162return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(symbol); 1288.Construct(Compilation.GetSpecialType(SpecialType.System_Object))); 1291return variableTypes.Select(v => new TypeInferenceInfo(enumerableType.Construct(v.InferredType))); 1779return CreateResult(taskOfT.Construct(this.Compilation.ObjectType)); 1809return CreateResult(ienumerableType.Construct(typeArg)); 2019return types.Select(t => t.InferredType.SpecialType == SpecialType.System_Void ? new TypeInferenceInfo(task) : new TypeInferenceInfo(taskOfT.Construct(t.InferredType)));
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (1)
139? compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(container)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
408var listOfIntType = listType.Construct(intType);
Microsoft.CodeAnalysis.Features (6)
ExtractMethod\MethodExtractor.Analyzer.cs (1)
228returnType = genericTaskType.Construct(returnType);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (2)
128? equatableType.Construct(_containingType.WithNullableAnnotation(NullableAnnotation.Annotated)) 129: equatableType.Construct(_containingType);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
146constructedType = equatableTypeOpt.Construct(containingType);
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
92=> _symbol.Construct(typeArguments);
SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
648typeSymbol = typeSymbol.Construct(typeArguments.Select(t => t.Type).ToArray());
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamedTypeSymbol.vb (1)
1176Private Function INamedTypeSymbol_Construct(ParamArray typeArguments() As ITypeSymbol) As INamedTypeSymbol Implements INamedTypeSymbol.Construct
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (8)
VisualBasicConvertToIteratorCodeFixProvider.vb (1)
74ienumerableSymbol = ienumerableSymbol.Construct(method.ReturnType.GetTypeArguments().First())
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
VisualBasicTypeInferenceService.TypeInferrer.vb (6)
486Return types.Select(Function(t) New TypeInferenceInfo(If(t.InferredType.SpecialType = SpecialType.System_Void, task, taskOfT.Construct(t.InferredType)))) 505New TypeInferenceInfo(Me.Compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(t.InferredType)), 661Return variableTypes.Select(Function(t) New TypeInferenceInfo(type.Construct(t.InferredType))) 665Return CreateResult(type.Construct(Compilation.GetSpecialType(SpecialType.System_Object))) 922Return CreateResult(taskOfT.Construct(Me.Compilation.ObjectType)) 950Return CreateResult(ienumerableType.Construct(typeArg))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (4)
CodeGen\CodeGenTuples.vb (4)
8936Dim vt2 = comp.CreateErrorTypeSymbol(Nothing, "ValueTuple", 2).Construct(intType, intType) 8980vt2 = comp.CreateErrorTypeSymbol(comp.CreateErrorNamespaceSymbol(comp.GlobalNamespace, "System"), "ValueTuple", 2).Construct(intType, intType) 8983vt2 = comp.CreateErrorTypeSymbol(comp.CreateErrorNamespaceSymbol(comp.Assembly.GlobalNamespace, "System"), "ValueTuple", 2).Construct(intType, intType) 8986vt2 = comp.CreateErrorTypeSymbol(comp.CreateErrorNamespaceSymbol(comp.SourceModule.GlobalNamespace, "System"), "ValueTuple", 2).Construct(intType, intType)
Microsoft.CodeAnalysis.VisualBasic.Features (2)
VisualBasicConvertToIteratorCodeFixProvider.vb (1)
74ienumerableSymbol = ienumerableSymbol.Construct(method.ReturnType.GetTypeArguments().First())
VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
89Dim returnType = knownTypes.TaskOfTType.Construct(methodSymbol.ReturnType).GenerateTypeSyntax().WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
SymbolsTests\CustomModifiersTests.vb (2)
78nullable = nullable.Construct(i) 149dictionary = dictionary.Construct(i, i)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (8)
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (2)
101RewriteFunctionAsClause(taskOfT.Construct(returnType), asClauseOpt, semanticModel, position) 139RewriteFunctionAsClause(iEnumerableOfT.Construct(returnType), asClauseOpt, semanticModel, position)
VisualBasicTypeInferenceService.TypeInferrer.vb (6)
486Return types.Select(Function(t) New TypeInferenceInfo(If(t.InferredType.SpecialType = SpecialType.System_Void, task, taskOfT.Construct(t.InferredType)))) 505New TypeInferenceInfo(Me.Compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(t.InferredType)), 661Return variableTypes.Select(Function(t) New TypeInferenceInfo(type.Construct(t.InferredType))) 665Return CreateResult(type.Construct(Compilation.GetSpecialType(SpecialType.System_Object))) 922Return CreateResult(taskOfT.Construct(Me.Compilation.ObjectType)) 950Return CreateResult(ienumerableType.Construct(typeArg))
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.vb (2)
24Me._ienumerableInt = _emptyCompilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).Construct(_emptyCompilation.GetSpecialType(SpecialType.System_Int32)) 370Dim listOfIntType = listType.Construct(intType)
Microsoft.CodeAnalysis.Workspaces (9)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
621=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
Shared\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
55return symbol.ConstructedFrom.Construct(arguments.ToArray());
Shared\Extensions\ITypeSymbolExtensions.CompilationTypeGenerator.cs (1)
25=> namedType.Construct(typeArguments);
Shared\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
57return symbol.ConstructedFrom.Construct(arguments.ToArray());
Shared\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
57return symbol.ConstructedFrom.Construct(arguments.ToArray());
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
386var constructed = iequatableType.Construct(memberType);
SymbolKey.ErrorTypeSymbolKey.cs (1)
99var errorType = typeArgumentsArray != null ? originalType.Construct(typeArgumentsArray) : originalType;
SymbolKey.NamedTypeSymbolKey.cs (1)
191var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
SyntaxGeneratorExtensions.cs (1)
67: generatorInternal.Type(equalityComparerType.Construct(type), typeContext: false);
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
SymbolKeyTests.cs (5)
670var constructed = type.Construct(compilation.GetSpecialType(SpecialType.System_Int32), type.TypeParameters[1]); 690var constructed = outer.Construct(compilation.GetSpecialType(SpecialType.System_String)); 720var a_string = a.Construct(compilation.GetSpecialType(SpecialType.System_String)); 727var a_string_b_int = a_string_b.Construct(compilation.GetSpecialType(SpecialType.System_Int32)); 735var a_b_int = a_b.Construct(compilation.GetSpecialType(SpecialType.System_Int32));
UtilityTest\DocumentationCommentIdTests.cs (1)
339var ienumTP = ienum.Construct(outerType.TypeArguments[0]);