17 instantiations of BoundTypeExpression
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder_Expressions.cs (1)
8201result = new BoundTypeExpression(
Binder\Binder_Invocation.cs (1)
434receiverOpt: new BoundTypeExpression(node, null, this.ContainingType).MakeCompilerGenerated(),
Generated\BoundNodes.xml.Generated.cs (1)
1093var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (1)
1061receiver = 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), 761receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 788receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt),
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
52loweredReceiver = new BoundTypeExpression(node.Syntax, null, firstContainer); 58loweredReceiver = new BoundTypeExpression(node.Syntax, null, _factory.CurrentType);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
1129receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 1274receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 1351receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt),
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
430BoundTypeExpression boundIDisposableTypeExpr = new BoundTypeExpression(forEachSyntax,
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (3)
118receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), 653receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt), 683receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt),
Lowering\SyntheticBoundNodeFactory.cs (1)
1296return new BoundTypeExpression(Syntax, null, type) { WasCompilerGenerated = true };
152 references to BoundTypeExpression
Microsoft.CodeAnalysis.CSharp (152)
Binder\Binder.ValueChecks.cs (2)
713var type = (BoundTypeExpression)expr;
Binder\Binder_Expressions.cs (8)
1390BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, type.IsErrorType()); 1429BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, typeHasErrors); 1481var typeExpression = new BoundTypeExpression(node.Type, aliasOpt: alias, typeWithAnnotations); 8143qualifierOpt: left is BoundTypeExpression typeExpr ? typeExpr.Type : null); 8204boundContainingTypeOpt: left as BoundTypeExpression, 8608if (receiverOpt is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 10387case BoundTypeExpression: 10472case BoundTypeExpression:
Binder\Binder_Operators.cs (4)
3190private bool IsOperatorErrors(CSharpSyntaxNode node, TypeSymbol operandType, BoundTypeExpression typeExpression, BindingDiagnosticBag diagnostics) 3225if (!tryBindAsType(node.Right, diagnostics, out BindingDiagnosticBag isTypeDiagnostics, out BoundTypeExpression typeExpression) && 3337out BoundTypeExpression boundType) 3692var typeExpression = new BoundTypeExpression(node.Right, alias, targetTypeWithAnnotations);
Binder\Binder_Patterns.cs (10)
447var boundType = (BoundTypeExpression)convertedExpression; 495/// and in that case it returns a <see cref="BoundTypeExpression"/>. 844BoundTypeExpression boundDeclType = BindTypeForPattern(typeSyntax, inputType, diagnostics, ref hasErrors); 851private BoundTypeExpression BindTypeForPattern( 860BoundTypeExpression boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, typeWithAnnotations: declType); 931out BoundTypeExpression? boundDeclType) 973TypeWithAnnotations declTypeWithAnnotations = BindRecursivePatternType(typeSyntax, inputType, diagnostics, ref hasErrors, out BoundTypeExpression? boundDeclType); 1362var boundOperandType = new BoundTypeExpression(syntax: node, aliasOpt: null, typeWithAnnotations: declType); // fake a type expression for the variable's type 1618var patternType = BindTypeForPattern(node.Type, inputType, diagnostics, ref hasErrors);
Binder\Binder_Statements.cs (1)
1129BoundTypeExpression boundDeclType = null;
Binder\ForEachLoopBinder.cs (1)
266BoundTypeExpression boundIterationVariableType;
Binder\RefSafetyAnalysis.cs (1)
579static uint getDeclarationValEscape(BoundTypeExpression typeExpression, uint 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)
543public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 549public 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)
1668if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\Optimizer.cs (2)
1172if ((method.IsAbstract || method.IsVirtual) && receiver is BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } } typeExpression) 2263if (receiverOpt is BoundTypeExpression { AliasOpt: null, BoundContainingTypeOpt: null, BoundDimensionsOpt: { IsEmpty: true }, Type: { TypeKind: TypeKind.TypeParameter } } typeExpression)
Compilation\CSharpSemanticModel.cs (2)
3393var boundType = (BoundTypeExpression)boundNode;
Compilation\MemberSemanticModel.NodeMapBuilder.cs (2)
98TypeSymbol.Equals(((BoundTypeExpression)existing[i]).Type, ((BoundTypeOrValueExpression)nodesToAdd[i]).Type, TypeCompareKind.ConsiderEverything2), 106TypeSymbol.Equals(((BoundTypeOrValueExpression)existing[i]).Type, ((BoundTypeExpression)nodesToAdd[i]).Type, TypeCompareKind.ConsiderEverything2),
FlowAnalysis\AbstractFlowPass.cs (1)
1584public override BoundNode VisitTypeExpression(BoundTypeExpression node)
FlowAnalysis\NullableWalker.cs (3)
346|| expression is BoundTypeExpression); 11016public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 11322var typeExpr = node.TargetType;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
267public override BoundNode? VisitTypeExpression(BoundTypeExpression node)
Generated\BoundNodes.xml.Generated.cs (85)
1068public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1081public BoundTypeExpression? BoundContainingTypeOpt { get; } 1089public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 1093var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors); 2232public BoundTypeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false) 2242public BoundTypeExpression SourceType { get; } 2247public BoundTypeOfOperator Update(BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type) 2816public BoundDefaultExpression(SyntaxNode syntax, BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2827public BoundTypeExpression? TargetType { get; } 2833public BoundDefaultExpression Update(BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type) 2847public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false) 2862public BoundTypeExpression TargetType { get; } 2868public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type) 2882public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false) 2898public BoundTypeExpression TargetType { get; } 2905public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type) 2919public BoundSizeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2931public BoundTypeExpression SourceType { get; } 2937public 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, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol 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, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 8101public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8113public BoundTypeExpression DeclaredType { get; } 8119public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8133public 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) 8147public BoundTypeExpression? DeclaredType { get; } 8156public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8393public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8405public BoundTypeExpression DeclaredType { get; } 8411public BoundTypePattern Update(BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType) 8875return VisitTypeExpression((BoundTypeExpression)node, arg); 9324public virtual R VisitTypeExpression(BoundTypeExpression node, A arg) => this.DefaultVisit(node, arg); 9560public virtual BoundNode? VisitTypeExpression(BoundTypeExpression node) => this.DefaultVisit(node); 9832public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10910public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10912BoundTypeExpression? boundContainingTypeOpt = (BoundTypeExpression?)this.Visit(node.BoundContainingTypeOpt); 11128BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 11210BoundTypeExpression? targetType = node.TargetType; 11217BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 11224BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 11232BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 11299BoundTypeExpression? declaredTypeOpt = (BoundTypeExpression?)this.Visit(node.DeclaredTypeOpt); 11389BoundTypeExpression iterationVariableType = (BoundTypeExpression)this.Visit(node.IterationVariableType); 12066BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 12074BoundTypeExpression? declaredType = (BoundTypeExpression?)this.Visit(node.DeclaredType); 12130BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 12463public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 12465BoundTypeExpression? boundContainingTypeOpt = (BoundTypeExpression?)this.Visit(node.BoundContainingTypeOpt); 12467BoundTypeExpression updatedNode; 12979BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 13193BoundTypeExpression? targetType = node.TargetType; 13211BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 13229BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 13248BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 13375BoundTypeExpression? declaredTypeOpt = (BoundTypeExpression?)this.Visit(node.DeclaredTypeOpt); 13432BoundTypeExpression iterationVariableType = (BoundTypeExpression)this.Visit(node.IterationVariableType); 14728BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 14739BoundTypeExpression? declaredType = (BoundTypeExpression?)this.Visit(node.DeclaredType); 14799BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 15127public override TreeDumperNode VisitTypeExpression(BoundTypeExpression node, object? arg) => new TreeDumperNode("typeExpression", null, new TreeDumperNode[]
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
62var constrainedToTypeOpt = ((targetMethod.IsAbstract || targetMethod.IsVirtual) && boundDelegateCreation.Argument is BoundTypeExpression typeExpression) ? typeExpression.Type : null;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
166if ((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)
202Debug.Assert(receiverOpt is not BoundTypeExpression || method.IsStatic); 203var needToReduce = receiverOpt is not (null or BoundTypeExpression) && interceptor.IsExtensionMethod;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
430BoundTypeExpression boundIDisposableTypeExpr = new BoundTypeExpression(forEachSyntax,
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (3)
19var rewrittenTargetType = (BoundTypeExpression)VisitTypeExpression(node.TargetType); 29BoundTypeExpression rewrittenTargetType,
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
227loweredReceiver = _factory.Typeof(((BoundTypeExpression)loweredReceiver).Type, _factory.WellKnownType(WellKnownType.System_Type));
Lowering\SpillSequenceSpiller.cs (1)
1022if (builder == null || node.ReceiverOpt is BoundTypeExpression)
Lowering\SyntheticBoundNodeFactory.cs (1)
1294public 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"/>.