91 references to CreateErrorType
Microsoft.CodeAnalysis.CSharp (91)
Binder\Binder_AnonymousTypes.cs (2)
224expressionType = CreateErrorType(SyntaxFacts.GetText(SyntaxKind.VoidKeyword)); 244expressionType = CreateErrorType("error");
Binder\Binder_Attributes.cs (2)
523return new BoundAssignmentOperator(namedArgument, badLHS, rhs, CreateErrorType()); 552namedArgumentType = CreateErrorType(); // don't generate cascaded errors.
Binder\Binder_Await.cs (1)
40TypeSymbol awaitExpressionType = info.GetResult?.ReturnType ?? (hasErrors ? CreateErrorType() : Compilation.DynamicType);
Binder\Binder_Conversions.cs (2)
215type = CreateErrorType(); 259source = ConvertConditionalExpression((BoundUnconvertedConditionalOperator)source, CreateErrorType(), conversionIfTargetTyped: null, diagnostics, hasErrors);
Binder\Binder_Deconstruct.cs (1)
159TypeSymbol returnType = hasErrors ? CreateErrorType() : lhsTuple.Type!;
Binder\Binder_Expressions.cs (27)
152CreateErrorType()); 165CreateErrorType()); 178CreateErrorType()) 221resultType ?? CreateErrorType()); 298commonType = CreateErrorType(); 311type = CreateErrorType(); 360CreateErrorType(), 398result = BindCollectionExpressionForErrorRecovery(expr, CreateErrorType(), inConversion: false, diagnostics); 424delegateType = CreateErrorType(); 855CreateErrorType("ref")); 862return new BoundTypeExpression(node, null, CreateErrorType("ref")); 869return new BoundTypeExpression(node, null, CreateErrorType("scoped")); 941declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1042ImmutableArray.Create<BoundExpression>(boundArgument), CreateErrorType("void")); 2471return new BoundThisReference(node, thisTypeOpt ?? CreateErrorType(), hasErrors) { WasCompilerGenerated = wasCompilerGenerated }; 4074bestType = CreateErrorType(); 4101bestType = CreateErrorType(); 5197return new BoundBadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType()); 5524var result = MakeBadExpressionForObjectCreation(node.Syntax, CreateErrorType(), arguments, node.InitializerOpt, typeSyntax: node.Syntax, diagnostics); 7776return new BoundBadExpression(node, LookupResultKind.Ambiguous, lookupResult.Symbols.AsImmutable(), ImmutableArray.Create(boundLeft), CreateErrorType(rightName), hasErrors: true); 7813return new BoundBadExpression(node, lookupResult.Kind, symbols.AsImmutable(), ImmutableArray.Create(boundLeft), CreateErrorType(rightName), hasErrors: true); 8182return resultType ?? CreateErrorType(); 9267return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes, CreateErrorType(), hasErrors: true); 10216TypeSymbol propertyType = GetCommonTypeOrReturnType(propertyGroup) ?? CreateErrorType(); 10950return new BoundConditionalAccess(node, receiver, access, CreateErrorType(), hasErrors: true); 11044return new BoundConditionalAccess(node, receiver, access, CreateErrorType(), hasErrors: true); 11099receiver = new BoundConditionalReceiver(receiver.Syntax, 0, receiverType ?? CreateErrorType(), hasErrors: receiver.HasErrors) { WasCompilerGenerated = true };
Binder\Binder_Operators.cs (19)
52leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, LookupResultKind.Empty, CreateErrorType(), hasErrors: true); 95leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, LookupResultKind.Empty, CreateErrorType(), hasErrors: true); 109leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, LookupResultKind.NotAVariable, CreateErrorType(), hasErrors: true); 130leftPlaceholder: null, leftConversion: null, finalPlaceholder: null, finalConversion: null, resultKind, originalUserDefinedOperators, CreateErrorType(), hasErrors: true); 714resultSignature = new BinaryOperatorSignature(kind, leftType: null, rightType: null, CreateErrorType()); 1048return new BoundBinaryOperator(node, kind, left, right, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, lookupResult, originalUserDefinedOperators, CreateErrorType(), true); 1302return CreateErrorType(); 2282CreateErrorType(), 2326CreateErrorType(), 2471return new BoundPointerIndirectionOperator(node, operand, refersToLocation: false, pointedAtType ?? CreateErrorType(), hasErrors); 2524return new BoundAddressOfOperator(node, operand, CreateErrorType(), hasErrors: true); 2743type: CreateErrorType(), 2782CreateErrorType(), 3977leftPlaceholder: null, leftConversion: null, BoundNullCoalescingOperatorResultKind.NoCommonType, @checked: CheckOverflowAtRuntime, CreateErrorType(), hasErrors: true); 3992leftPlaceholder: null, leftConversion: null, BoundNullCoalescingOperatorResultKind.NoCommonType, @checked: CheckOverflowAtRuntime, CreateErrorType(), hasErrors: true); 4001leftPlaceholder: null, leftConversion: null, BoundNullCoalescingOperatorResultKind.NoCommonType, @checked: CheckOverflowAtRuntime, CreateErrorType(), hasErrors: true); 4180return new BoundNullCoalescingAssignmentOperator(node, leftOperand, rightOperand, CreateErrorType(), hasErrors: true); 4233return new BoundNullCoalescingAssignmentOperator(node, leftOperand, rightOperand, CreateErrorType(), hasErrors: true); 4353type = CreateErrorType();
Binder\Binder_Patterns.cs (9)
370lengthAccess = new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType(), hasErrors: true) { WasCompilerGenerated = true }; 969inputType = CreateErrorType(); 1067TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type; 1172TypeSymbol elementType = isError ? CreateErrorType() : elementTypesWithAnnotations[i].Type; 1328inputType = CreateErrorType(); 1422TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type; 1445TypeSymbol elementType = isError ? CreateErrorType() : elementTypes[i].Type; 1481memberType = CreateErrorType(); 1533_ => CreateErrorType()
Binder\Binder_Query.cs (4)
736yExpression = new BoundBadExpression(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), CreateErrorType()); 823return e.Type ?? CreateErrorType(); 975receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType()); 997receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType());
Binder\Binder_Statements.cs (2)
1028declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1043declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Binder_Symbols.cs (1)
607return TypeWithAnnotations.Create(CreateErrorType());
Binder\Binder_TupleOperators.cs (1)
194TypeSymbol dynamicType = hasError ? CreateErrorType() : Compilation.DynamicType;
Binder\Binder_WithExpression.cs (1)
26receiverType = CreateErrorType();
Binder\ForEachLoopBinder.cs (4)
200var valuePlaceholder = new BoundDeconstructValuePlaceholder(_syntax.Expression, variableSymbol: null, isDiscardExpression: false, inferredType.Type ?? CreateErrorType("var")); 255var placeholder = new BoundAwaitableValuePlaceholder(expr, builder.MoveNextInfo?.Method.ReturnType ?? CreateErrorType()); 303declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 370iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\InMethodBinder.cs (1)
139return !elementType.IsDefault ? elementType : TypeWithAnnotations.Create(CreateErrorType());
Binder\SwitchBinder.cs (2)
435switchGoverningType = CreateErrorType(switchGoverningType.Name); 446return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(switchGoverningExpression), switchGoverningType ?? CreateErrorType());
Binder\SwitchExpressionBinder.cs (1)
203switchGoverningExpression = this.GenerateConversionForAssignment(CreateErrorType(), switchGoverningExpression, diagnostics);
Binder\WithLambdaParametersBinder.cs (1)
75return TypeWithAnnotations.Create(CreateErrorType());
BoundTree\BoundDiscardExpression.cs (1)
25return this.Update(NullableAnnotation.Oblivious, this.IsInferred, binder.CreateErrorType("var"));
BoundTree\OutDeconstructVarPendingInference.cs (1)
24return SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(binder.CreateErrorType()), success: false);
BoundTree\UnboundLambda.cs (1)
1213: this.Binder.CreateErrorType();
BoundTree\VariablePendingInference.cs (1)
45type = TypeWithAnnotations.Create(binderOpt!.CreateErrorType("var"));
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
33returnType = TypeWithAnnotations.Create(typeBinder.CreateErrorType());
Symbols\Source\GlobalExpressionVariable.cs (1)
113type = TypeWithAnnotations.Create(binder.CreateErrorType("var"));
Symbols\Source\SourceLocalSymbol.cs (3)
371declType = TypeWithAnnotations.Create(typeBinder.CreateErrorType("var")); 698return TypeWithAnnotations.Create(_nodeBinder.CreateErrorType()); 813SetTypeWithAnnotations(TypeWithAnnotations.Create(_nodeBinder.CreateErrorType("var")));
Symbols\Source\SourceMemberFieldSymbol.cs (1)
554type = TypeWithAnnotations.Create(binder.CreateErrorType("var"));