37 instantiations of BoundTypeExpression
Microsoft.CodeAnalysis.CSharp (37)
Binder\Binder_Expressions.cs (12)
869return new BoundTypeExpression(node, null, CreateErrorType("ref")); 876return new BoundTypeExpression(node, null, CreateErrorType("scoped")); 1399BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, type.IsErrorType()); 1438BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, typeHasErrors); 1573var typeExpression = new BoundTypeExpression(node.Type, aliasOpt: alias, typeWithAnnotations); 1701expression = new BoundTypeExpression(node, null, type); 2210return new BoundTypeExpression(node, null, (TypeSymbol)symbol, hasErrors: isError); 2238TypeSymbol typeSymbol => new BoundTypeExpression(node, alias, typeSymbol, hasErrors: isError), 2488return new BoundTypeExpression(node, alias, type); 7855return new BoundTypeExpression(node, null, type); 7865return new BoundTypeExpression(node, null, 8480result = new BoundTypeExpression(
Binder\Binder_InterpolatedString.cs (1)
344new BoundTypeExpression(syntax, null, factoryType) { WasCompilerGenerated = true },
Binder\Binder_Invocation.cs (1)
442receiverOpt: new BoundTypeExpression(node, null, this.ContainingType).MakeCompilerGenerated(),
Binder\Binder_Operators.cs (2)
4769boundType = new BoundTypeExpression(possibleType, alias, targetTypeWithAnnotations); 5121var typeExpression = new BoundTypeExpression(node.Right, alias, targetTypeWithAnnotations);
Binder\Binder_Patterns.cs (2)
861BoundTypeExpression boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, typeWithAnnotations: declType); 1363var boundOperandType = new BoundTypeExpression(syntax: node, aliasOpt: null, typeWithAnnotations: declType); // fake a type expression for the variable's type
Binder\Binder_Statements.cs (1)
1151boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, dimensionsOpt: invalidDimensions.ToImmutableAndFree(), typeWithAnnotations: declTypeOpt);
Binder\ForEachLoopBinder.cs (2)
319boundIterationVariableType = new BoundTypeExpression(typeSyntax, alias, iterationVariableType); 422boundIterationVariableType = new BoundTypeExpression(variables, aliasOpt: null, typeWithAnnotations: iterationVariableType).MakeCompilerGenerated();
Compilation\AttributeSemanticModel.cs (1)
94return new BoundTypeExpression((NameSyntax)node, _aliasOpt, type: AttributeType);
Generated\BoundNodes.xml.Generated.cs (1)
1075var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (1)
1066receiver = new BoundTypeExpression(syntax, null, synthesizedMethod.ContainingType);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
87var falseOperatorCall = BoundCall.Synthesized(syntax, receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt), 779receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 806receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt),
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
51loweredReceiver = new BoundTypeExpression(node.Syntax, null, firstContainer); 58loweredReceiver = new BoundTypeExpression(node.Syntax, null, _factory.CurrentType);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
1228receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 1373receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 1450receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt),
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
434BoundTypeExpression boundIDisposableTypeExpr = new BoundTypeExpression(forEachSyntax,
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (3)
119receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 812receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt), 842receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt),
Lowering\SyntheticBoundNodeFactory.cs (1)
1258return new BoundTypeExpression(Syntax, null, type) { WasCompilerGenerated = true };
158 references to BoundTypeExpression
Microsoft.CodeAnalysis.CSharp (158)
Binder\Binder.ValueChecks.cs (3)
964var type = (BoundTypeExpression)expr; 1620Debug.Assert(fieldAccess.ReceiverOpt is null or BoundTypeExpression);
Binder\Binder_Expressions.cs (11)
1399BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, type.IsErrorType()); 1438BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, typeHasErrors); 1573var typeExpression = new BoundTypeExpression(node.Type, aliasOpt: alias, typeWithAnnotations); 7896Debug.Assert(boundLeft is BoundTypeExpression); 8050if (receiver is not BoundTypeExpression) 8421qualifierOpt: left is BoundTypeExpression typeExpr ? typeExpr.Type : null); 8483boundContainingTypeOpt: left as BoundTypeExpression, 9046if (receiverOpt is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 10818case BoundTypeExpression: 10977BoundTypeExpression => !memberCountsAsStatic, 11012case BoundTypeExpression:
Binder\Binder_Invocation.cs (1)
1311else if (isNewExtensionMethod && receiver is not BoundTypeExpression)
Binder\Binder_Operators.cs (4)
4617private bool IsOperatorErrors(CSharpSyntaxNode node, TypeSymbol operandType, BoundTypeExpression typeExpression, BindingDiagnosticBag diagnostics) 4652if (!tryBindAsType(node.Right, diagnostics, out BindingDiagnosticBag isTypeDiagnostics, out BoundTypeExpression typeExpression) && 4764out BoundTypeExpression boundType) 5121var typeExpression = new BoundTypeExpression(node.Right, alias, targetTypeWithAnnotations);
Binder\Binder_Patterns.cs (10)
448var boundType = (BoundTypeExpression)convertedExpression; 496/// and in that case it returns a <see cref="BoundTypeExpression"/>. 845BoundTypeExpression boundDeclType = BindTypeForPattern(typeSyntax, inputType, diagnostics, ref hasErrors); 852private BoundTypeExpression BindTypeForPattern( 861BoundTypeExpression boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, typeWithAnnotations: declType); 932out BoundTypeExpression? boundDeclType) 974TypeWithAnnotations declTypeWithAnnotations = BindRecursivePatternType(typeSyntax, inputType, diagnostics, ref hasErrors, out BoundTypeExpression? boundDeclType); 1363var boundOperandType = new BoundTypeExpression(syntax: node, aliasOpt: null, typeWithAnnotations: declType); // fake a type expression for the variable's type 1619var patternType = BindTypeForPattern(node.Type, inputType, diagnostics, ref hasErrors);
Binder\Binder_Statements.cs (1)
1132BoundTypeExpression boundDeclType = null;
Binder\ForEachLoopBinder.cs (1)
274BoundTypeExpression boundIterationVariableType;
Binder\RefSafetyAnalysis.cs (1)
629static SafeContext getDeclarationValEscape(BoundTypeExpression typeExpression, SafeContext valEscape)
Binder\SwitchBinder.cs (1)
213if (boundLabelExpression is BoundTypeExpression type)
BoundTree\BoundNode_Source.cs (1)
185case BoundTypeExpression type:
BoundTree\BoundTreeVisitors.cs (1)
34return VisitTypeExpression(node as BoundTypeExpression, arg);
BoundTree\Constructors.cs (2)
479public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 485public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false)
CodeGen\EmitConversion.cs (1)
331if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\EmitExpression.cs (1)
1685if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\Optimizer.cs (2)
1181if ((method.IsAbstract || method.IsVirtual) && receiver is BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } } typeExpression) 2272if (receiverOpt is BoundTypeExpression { AliasOpt: null, BoundContainingTypeOpt: null, BoundDimensionsOpt: { IsEmpty: true }, Type: { TypeKind: TypeKind.TypeParameter } } typeExpression)
Compilation\CSharpSemanticModel.cs (2)
3405var boundType = (BoundTypeExpression)boundNode;
Compilation\MemberSemanticModel.NodeMapBuilder.cs (2)
96TypeSymbol.Equals(((BoundTypeExpression)existing[i]).Type, ((BoundTypeOrValueExpression)nodesToAdd[i]).Type, TypeCompareKind.ConsiderEverything2), 104TypeSymbol.Equals(((BoundTypeOrValueExpression)existing[i]).Type, ((BoundTypeExpression)nodesToAdd[i]).Type, TypeCompareKind.ConsiderEverything2),
FlowAnalysis\AbstractFlowPass.cs (1)
1649public override BoundNode VisitTypeExpression(BoundTypeExpression node)
FlowAnalysis\NullableWalker.cs (3)
371|| expression is BoundTypeExpression); 12060public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 12470var typeExpr = node.TargetType;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
342public override BoundNode? VisitTypeExpression(BoundTypeExpression node)
Generated\BoundNodes.xml.Generated.cs (85)
1050public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1063public BoundTypeExpression? BoundContainingTypeOpt { get; } 1071public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 1075var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors); 2230public BoundTypeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false) 2240public BoundTypeExpression SourceType { get; } 2245public BoundTypeOfOperator Update(BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type) 2818public BoundDefaultExpression(SyntaxNode syntax, BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2829public BoundTypeExpression? TargetType { get; } 2835public BoundDefaultExpression Update(BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type) 2849public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false) 2864public BoundTypeExpression TargetType { get; } 2870public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type) 2884public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false) 2900public BoundTypeExpression TargetType { get; } 2907public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type) 2921public BoundSizeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2933public BoundTypeExpression SourceType { get; } 2939public BoundSizeOfOperator Update(BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type) 3400public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType, bool hasErrors = false) 3414public BoundTypeExpression? DeclaredTypeOpt { get; } 3422public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType) 4036public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors = false) 4062public BoundTypeExpression IterationVariableType { get; } 4073public BoundForEachStatement Update(ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel) 8115public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8131public BoundTypeExpression DeclaredType { get; } 8137public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8151public BoundRecursivePattern(SyntaxNode syntax, BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8169public BoundTypeExpression? DeclaredType { get; } 8178public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8419public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8435public BoundTypeExpression DeclaredType { get; } 8441public BoundTypePattern Update(BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType) 8917return VisitTypeExpression((BoundTypeExpression)node, arg); 9366public virtual R VisitTypeExpression(BoundTypeExpression node, A arg) => this.DefaultVisit(node, arg); 9602public virtual BoundNode? VisitTypeExpression(BoundTypeExpression node) => this.DefaultVisit(node); 9874public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10962public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10965BoundTypeExpression? boundContainingTypeOpt = (BoundTypeExpression?)this.Visit(node.BoundContainingTypeOpt); 11203BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 11295BoundTypeExpression? targetType = node.TargetType; 11302BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 11309BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 11317BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 11391BoundTypeExpression? declaredTypeOpt = (BoundTypeExpression?)this.Visit(node.DeclaredTypeOpt); 11507BoundTypeExpression iterationVariableType = (BoundTypeExpression)this.Visit(node.IterationVariableType); 12249BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 12259BoundTypeExpression? declaredType = (BoundTypeExpression?)this.Visit(node.DeclaredType); 12320BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 12658public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 12660BoundTypeExpression? boundContainingTypeOpt = (BoundTypeExpression?)this.Visit(node.BoundContainingTypeOpt); 12662BoundTypeExpression updatedNode; 13153BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 13375BoundTypeExpression? targetType = node.TargetType; 13393BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 13411BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 13430BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 13556BoundTypeExpression? declaredTypeOpt = (BoundTypeExpression?)this.Visit(node.DeclaredTypeOpt); 13613BoundTypeExpression iterationVariableType = (BoundTypeExpression)this.Visit(node.IterationVariableType); 14909BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 14920BoundTypeExpression? declaredType = (BoundTypeExpression?)this.Visit(node.DeclaredType); 14980BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 15308public override TreeDumperNode VisitTypeExpression(BoundTypeExpression node, object? arg) => new TreeDumperNode("typeExpression", null, new TreeDumperNode[]
Lowering\ExtensionMethodReferenceRewriter.cs (1)
219if (!isExtensionMethod && argument is not BoundTypeExpression && methodOpt?.IsStatic == true)
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
68var constrainedToTypeOpt = ((targetMethod.IsAbstract || targetMethod.IsVirtual) && boundDelegateCreation.Argument is BoundTypeExpression typeExpression) ? typeExpression.Type : null;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
172if ((targetMethod.IsAbstract || targetMethod.IsVirtual) && boundDelegateCreation.Argument is BoundTypeExpression typeExpression)
Lowering\LocalRewriter\LocalRewriter.cs (2)
652var sourceType = (BoundTypeExpression?)this.Visit(node.SourceType);
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (4)
19var rewrittenTargetType = (BoundTypeExpression)VisitTypeExpression(node.TargetType); 25public override BoundNode VisitTypeExpression(BoundTypeExpression node) 36BoundTypeExpression rewrittenTargetType,
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
214Debug.Assert(receiverOpt is not BoundTypeExpression || method.IsStatic); 215var needToReduce = receiverOpt is not (null or BoundTypeExpression) && interceptor.IsExtensionMethod;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
434BoundTypeExpression boundIDisposableTypeExpr = new BoundTypeExpression(forEachSyntax,
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (3)
19var rewrittenTargetType = (BoundTypeExpression)VisitTypeExpression(node.TargetType); 29BoundTypeExpression rewrittenTargetType,
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
228loweredReceiver = _factory.Typeof(((BoundTypeExpression)loweredReceiver).Type, _factory.WellKnownType(WellKnownType.System_Type));
Lowering\SpillSequenceSpiller.cs (1)
1033if (builder == null || node.ReceiverOpt is BoundTypeExpression)
Lowering\SyntheticBoundNodeFactory.cs (1)
1256public BoundTypeExpression Type(TypeSymbol type)
Operations\CSharpOperationFactory.cs (3)
464receiverOpt is BoundTypeExpression { Type: TypeParameterSymbol typeParameter }) 526BoundTypeExpression? declaredTypeOpt = ((BoundLocalDeclaration)declaration).DeclaredTypeOpt; 537BoundTypeExpression? declaredTypeOpt = declarations[0].DeclaredTypeOpt;
Symbols\TypeWithAnnotations.cs (2)
779/// Used by the generated <see cref="BoundTypeExpression.Update"/>. 787/// Used by the generated <see cref="BoundTypeExpression.Update"/>.