37 instantiations of BoundTypeExpression
Microsoft.CodeAnalysis.CSharp (36)
Binder\Binder_Expressions.cs (12)
826return new BoundTypeExpression(node, null, CreateErrorType("ref")); 833return new BoundTypeExpression(node, null, CreateErrorType("scoped")); 1356BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, type.IsErrorType()); 1395BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, typeHasErrors); 1447var typeExpression = new BoundTypeExpression(node.Type, aliasOpt: alias, typeWithAnnotations); 1571expression = new BoundTypeExpression(node, null, type); 1974return new BoundTypeExpression(node, null, (TypeSymbol)symbol, hasErrors: isError); 2005return new BoundTypeExpression(node, alias, (NamedTypeSymbol)symbol, hasErrors: isError); 2243return new BoundTypeExpression(node, alias, type); 6728return new BoundTypeExpression(node, null, type); 6738return new BoundTypeExpression(node, null, 7230result = new BoundTypeExpression(
Binder\Binder_Invocation.cs (1)
346receiverOpt: new BoundTypeExpression(node, null, this.ContainingType).MakeCompilerGenerated(),
Binder\Binder_Operators.cs (2)
3299boundType = new BoundTypeExpression(possibleType, alias, targetTypeWithAnnotations); 3622var typeExpression = new BoundTypeExpression(node.Right, alias, targetTypeWithAnnotations);
Binder\Binder_Patterns.cs (2)
851BoundTypeExpression boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, typeWithAnnotations: declType); 1353var boundOperandType = new BoundTypeExpression(syntax: node, aliasOpt: null, typeWithAnnotations: declType); // fake a type expression for the variable's type
Binder\Binder_Statements.cs (1)
1152boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, dimensionsOpt: invalidDimensions.ToImmutableAndFree(), typeWithAnnotations: declTypeOpt);
Binder\ForEachLoopBinder.cs (2)
296boundIterationVariableType = new BoundTypeExpression(typeSyntax, alias, iterationVariableType); 390boundIterationVariableType = 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)
1081var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (1)
1046receiver = new BoundTypeExpression(syntax, null, synthesizedMethod.ContainingType);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
86var falseOperatorCall = BoundCall.Synthesized(syntax, receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt), 757return BoundCall.Synthesized(syntax, receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), leftTruthOperator, loweredLeft); 779return BoundCall.Synthesized(syntax, receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), method, loweredLeft, loweredRight);
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)
1082return MakeLiftedUserDefinedConversionConsequence(BoundCall.Synthesized(syntax, receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), conversion.Method, nonNullValue), type); 1222BoundExpression result = BoundCall.Synthesized(syntax, receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), conversion.Method, rewrittenOperand); 1294BoundCall userDefinedCall = BoundCall.Synthesized(syntax, receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), conversion.Method, callGetValueOrDefault);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
365BoundTypeExpression boundIDisposableTypeExpr = new BoundTypeExpression(forEachSyntax,
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (3)
116return BoundCall.Synthesized(syntax, receiverOpt: constrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, constrainedToTypeOpt), method, loweredOperand); 644return BoundCall.Synthesized(syntax, receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt), node.MethodOpt, rewrittenArgument); 669BoundExpression userDefinedCall = BoundCall.Synthesized(syntax, receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt), node.MethodOpt, call_GetValueOrDefault);
Lowering\SyntheticBoundNodeFactory.cs (1)
1177return new BoundTypeExpression(Syntax, null, type) { WasCompilerGenerated = true };
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (1)
Rewriters\LocalDeclarationRewriter.cs (1)
109var type = new BoundTypeOfOperator(syntax, new BoundTypeExpression(syntax, aliasOpt: null, type: local.Type), null, typeType);
148 references to BoundTypeExpression
Microsoft.CodeAnalysis.CSharp (148)
Binder\Binder.ValueChecks.cs (2)
570var type = (BoundTypeExpression)expr;
Binder\Binder_Expressions.cs (7)
1356BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, type.IsErrorType()); 1395BoundTypeExpression boundType = new BoundTypeExpression(typeSyntax, alias, typeWithAnnotations, typeHasErrors); 1447var typeExpression = new BoundTypeExpression(node.Type, aliasOpt: alias, typeWithAnnotations); 7172qualifierOpt: left is BoundTypeExpression typeExpr ? typeExpr.Type : null); 7233boundContainingTypeOpt: left as BoundTypeExpression, 7622if (receiverOpt is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 9116case BoundTypeExpression:
Binder\Binder_Operators.cs (4)
3147private bool IsOperatorErrors(CSharpSyntaxNode node, TypeSymbol operandType, BoundTypeExpression typeExpression, BindingDiagnosticBag diagnostics) 3182if (!tryBindAsType(node.Right, diagnostics, out BindingDiagnosticBag isTypeDiagnostics, out BoundTypeExpression typeExpression) && 3294out BoundTypeExpression boundType) 3622var 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"/>. 835BoundTypeExpression boundDeclType = BindTypeForPattern(typeSyntax, inputType, diagnostics, ref hasErrors); 842private BoundTypeExpression BindTypeForPattern( 851BoundTypeExpression boundDeclType = new BoundTypeExpression(typeSyntax, aliasOpt, typeWithAnnotations: declType); 922out BoundTypeExpression? boundDeclType) 964TypeWithAnnotations declTypeWithAnnotations = BindRecursivePatternType(typeSyntax, inputType, diagnostics, ref hasErrors, out BoundTypeExpression? boundDeclType); 1353var boundOperandType = new BoundTypeExpression(syntax: node, aliasOpt: null, typeWithAnnotations: declType); // fake a type expression for the variable's type 1609var patternType = BindTypeForPattern(node.Type, inputType, diagnostics, ref hasErrors);
Binder\Binder_Statements.cs (1)
1133BoundTypeExpression boundDeclType = null;
Binder\ForEachLoopBinder.cs (1)
251BoundTypeExpression boundIterationVariableType;
Binder\RefSafetyAnalysis.cs (1)
505static uint getDeclarationValEscape(BoundTypeExpression typeExpression, uint valEscape)
Binder\SwitchBinder.cs (1)
209if (boundLabelExpression is BoundTypeExpression type)
BoundTree\BoundNode_Source.cs (1)
170case BoundTypeExpression type:
BoundTree\BoundTreeVisitors.cs (1)
34return VisitTypeExpression(node as BoundTypeExpression, arg);
BoundTree\Constructors.cs (2)
486public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 492public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false)
CodeGen\EmitConversion.cs (1)
330if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\EmitExpression.cs (1)
1628if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\Optimizer.cs (2)
1125if ((method.IsAbstract || method.IsVirtual) && receiver is BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } } typeExpression) 2146if (receiverOpt is BoundTypeExpression { AliasOpt: null, BoundContainingTypeOpt: null, BoundDimensionsOpt: { IsEmpty: true }, Type: { TypeKind: TypeKind.TypeParameter } } typeExpression)
Compilation\CSharpSemanticModel.cs (2)
3386var boundType = (BoundTypeExpression)boundNode;
Compilation\MemberSemanticModel.NodeMapBuilder.cs (2)
93TypeSymbol.Equals(((BoundTypeExpression)existing[i]).Type, ((BoundTypeOrValueExpression)added[i]).Type, TypeCompareKind.ConsiderEverything2), 101TypeSymbol.Equals(((BoundTypeOrValueExpression)existing[i]).Type, ((BoundTypeExpression)added[i]).Type, TypeCompareKind.ConsiderEverything2),
FlowAnalysis\AbstractFlowPass.cs (1)
1545public override BoundNode VisitTypeExpression(BoundTypeExpression node)
FlowAnalysis\NullableWalker.cs (2)
10282public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10590var typeExpr = node.TargetType;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
226public override BoundNode? VisitTypeExpression(BoundTypeExpression node)
Generated\BoundNodes.xml.Generated.cs (85)
1056public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1069public BoundTypeExpression? BoundContainingTypeOpt { get; } 1077public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 1081var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors); 2189public BoundTypeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false) 2199public BoundTypeExpression SourceType { get; } 2204public BoundTypeOfOperator Update(BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type) 2705public BoundDefaultExpression(SyntaxNode syntax, BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2716public BoundTypeExpression? TargetType { get; } 2722public BoundDefaultExpression Update(BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type) 2736public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false) 2751public BoundTypeExpression TargetType { get; } 2757public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type) 2771public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false) 2787public BoundTypeExpression TargetType { get; } 2794public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type) 2808public BoundSizeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2820public BoundTypeExpression SourceType { get; } 2826public BoundSizeOfOperator Update(BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type) 3289public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType, bool hasErrors = false) 3303public BoundTypeExpression? DeclaredTypeOpt { get; } 3311public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType) 3925public 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) 3951public BoundTypeExpression IterationVariableType { get; } 3962public 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) 7785public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 7797public BoundTypeExpression DeclaredType { get; } 7803public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 7817public 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) 7831public BoundTypeExpression? DeclaredType { get; } 7840public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8077public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8089public BoundTypeExpression DeclaredType { get; } 8095public BoundTypePattern Update(BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType) 8559return VisitTypeExpression((BoundTypeExpression)node, arg); 8992public virtual R VisitTypeExpression(BoundTypeExpression node, A arg) => this.DefaultVisit(node, arg); 9220public virtual BoundNode? VisitTypeExpression(BoundTypeExpression node) => this.DefaultVisit(node); 9484public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10533public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 10535BoundTypeExpression? boundContainingTypeOpt = (BoundTypeExpression?)this.Visit(node.BoundContainingTypeOpt); 10745BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 10817BoundTypeExpression? targetType = node.TargetType; 10824BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 10831BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 10839BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 10906BoundTypeExpression? declaredTypeOpt = (BoundTypeExpression?)this.Visit(node.DeclaredTypeOpt); 10996BoundTypeExpression iterationVariableType = (BoundTypeExpression)this.Visit(node.IterationVariableType); 11634BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 11642BoundTypeExpression? declaredType = (BoundTypeExpression?)this.Visit(node.DeclaredType); 11698BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 12031public override BoundNode? VisitTypeExpression(BoundTypeExpression node) 12033BoundTypeExpression? boundContainingTypeOpt = (BoundTypeExpression?)this.Visit(node.BoundContainingTypeOpt); 12035BoundTypeExpression updatedNode; 12530BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 12728BoundTypeExpression? targetType = node.TargetType; 12746BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 12764BoundTypeExpression targetType = (BoundTypeExpression)this.Visit(node.TargetType); 12783BoundTypeExpression sourceType = (BoundTypeExpression)this.Visit(node.SourceType); 12910BoundTypeExpression? declaredTypeOpt = (BoundTypeExpression?)this.Visit(node.DeclaredTypeOpt); 12967BoundTypeExpression iterationVariableType = (BoundTypeExpression)this.Visit(node.IterationVariableType); 14193BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 14204BoundTypeExpression? declaredType = (BoundTypeExpression?)this.Visit(node.DeclaredType); 14264BoundTypeExpression declaredType = (BoundTypeExpression)this.Visit(node.DeclaredType); 14592public 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)
580var 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_ForEachStatement.cs (1)
365BoundTypeExpression 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);
Lowering\SpillSequenceSpiller.cs (1)
951if (builder == null || node.ReceiverOpt is BoundTypeExpression)
Lowering\SyntheticBoundNodeFactory.cs (1)
1175public BoundTypeExpression Type(TypeSymbol type)
Operations\CSharpOperationFactory.cs (3)
461receiverOpt is BoundTypeExpression { Type: TypeParameterSymbol typeParameter }) 523BoundTypeExpression? declaredTypeOpt = ((BoundLocalDeclaration)declaration).DeclaredTypeOpt; 534BoundTypeExpression? declaredTypeOpt = declarations[0].DeclaredTypeOpt;
Symbols\TypeWithAnnotations.cs (2)
750/// Used by the generated <see cref="BoundTypeExpression.Update"/>. 758/// Used by the generated <see cref="BoundTypeExpression.Update"/>.