89 references to CreateErrorType
Microsoft.CodeAnalysis.CSharp (89)
Binder\Binder_AnonymousTypes.cs (2)
224expressionType = CreateErrorType(SyntaxFacts.GetText(SyntaxKind.VoidKeyword)); 244expressionType = CreateErrorType("error");
Binder\Binder_Attributes.cs (1)
532namedArgumentType = 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)
217type = CreateErrorType(); 239source = ConvertConditionalExpression((BoundUnconvertedConditionalOperator)source, CreateErrorType(), conversionIfTargetTyped: null, diagnostics, hasErrors);
Binder\Binder_Deconstruct.cs (1)
159TypeSymbol returnType = hasErrors ? CreateErrorType() : lhsTuple.Type!;
Binder\Binder_Expressions.cs (25)
151CreateErrorType()); 164CreateErrorType()); 177CreateErrorType()) 218resultType ?? CreateErrorType()); 295commonType = CreateErrorType(); 308type = CreateErrorType(); 357CreateErrorType(), 412delegateType = CreateErrorType(); 819CreateErrorType("ref")); 826return new BoundTypeExpression(node, null, CreateErrorType("ref")); 833return new BoundTypeExpression(node, null, CreateErrorType("scoped")); 905declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1006ImmutableArray.Create<BoundExpression>(boundArgument), CreateErrorType("void")); 2276return new BoundThisReference(node, thisTypeOpt ?? CreateErrorType(), hasErrors) { WasCompilerGenerated = wasCompilerGenerated }; 3420bestType = CreateErrorType(); 3447bestType = CreateErrorType(); 4727var result = MakeBadExpressionForObjectCreation(node.Syntax, CreateErrorType(), arguments, node.InitializerOpt, typeSyntax: node.Syntax, diagnostics); 6710return new BoundBadExpression(node, LookupResultKind.Ambiguous, lookupResult.Symbols.AsImmutable(), ImmutableArray.Create(boundLeft), CreateErrorType(rightName), hasErrors: true); 6747return new BoundBadExpression(node, lookupResult.Kind, symbols.AsImmutable(), ImmutableArray.Create(boundLeft), CreateErrorType(rightName), hasErrors: true); 7115return resultType ?? CreateErrorType(); 7929return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes, CreateErrorType(), hasErrors: true); 8850TypeSymbol propertyType = GetCommonTypeOrReturnType(propertyGroup) ?? CreateErrorType(); 9345return new BoundConditionalAccess(node, receiver, access, CreateErrorType(), hasErrors: true); 9439return new BoundConditionalAccess(node, receiver, access, CreateErrorType(), hasErrors: true); 9494receiver = new BoundConditionalReceiver(receiver.Syntax, 0, receiverType ?? CreateErrorType(), hasErrors: receiver.HasErrors) { WasCompilerGenerated = true };
Binder\Binder_Operators.cs (20)
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); 684resultSignature = new BinaryOperatorSignature(kind, leftType: null, rightType: null, CreateErrorType()); 1017return new BoundBinaryOperator(node, kind, left, right, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, lookupResult, originalUserDefinedOperators, CreateErrorType(), true); 1271return CreateErrorType(); 2251CreateErrorType(), 2295CreateErrorType(), 2440return new BoundPointerIndirectionOperator(node, operand, refersToLocation: false, pointedAtType ?? CreateErrorType(), hasErrors); 2493return new BoundAddressOfOperator(node, operand, CreateErrorType(), hasErrors: true); 2700type: CreateErrorType(), 2739CreateErrorType(), 3900leftPlaceholder: null, leftConversion: null, BoundNullCoalescingOperatorResultKind.NoCommonType, @checked: CheckOverflowAtRuntime, CreateErrorType(), hasErrors: true); 3915leftPlaceholder: null, leftConversion: null, BoundNullCoalescingOperatorResultKind.NoCommonType, @checked: CheckOverflowAtRuntime, CreateErrorType(), hasErrors: true); 3924leftPlaceholder: null, leftConversion: null, BoundNullCoalescingOperatorResultKind.NoCommonType, @checked: CheckOverflowAtRuntime, CreateErrorType(), hasErrors: true); 4103return new BoundNullCoalescingAssignmentOperator(node, leftOperand, rightOperand, CreateErrorType(), hasErrors: true); 4156return new BoundNullCoalescingAssignmentOperator(node, leftOperand, rightOperand, CreateErrorType(), hasErrors: true); 4253type = hasErrors ? CreateErrorType() : bestType; 4281type = CreateErrorType();
Binder\Binder_Patterns.cs (9)
370lengthAccess = new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType(), hasErrors: true) { WasCompilerGenerated = true }; 960inputType = CreateErrorType(); 1058TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type; 1163TypeSymbol elementType = isError ? CreateErrorType() : elementTypesWithAnnotations[i].Type; 1319inputType = CreateErrorType(); 1413TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type; 1436TypeSymbol elementType = isError ? CreateErrorType() : elementTypes[i].Type; 1472memberType = CreateErrorType(); 1524_ => CreateErrorType()
Binder\Binder_Query.cs (4)
735yExpression = new BoundBadExpression(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), CreateErrorType()); 822return e.Type ?? CreateErrorType(); 974receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType()); 996receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType());
Binder\Binder_Statements.cs (2)
1031declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1046declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Binder_Symbols.cs (1)
605return 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)
185var valuePlaceholder = new BoundDeconstructValuePlaceholder(_syntax.Expression, variableSymbol: null, isDiscardExpression: false, inferredType.Type ?? CreateErrorType("var")); 240var placeholder = new BoundAwaitableValuePlaceholder(expr, builder.MoveNextInfo?.Method.ReturnType ?? CreateErrorType()); 288declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 348iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\InMethodBinder.cs (1)
139return !elementType.IsDefault ? elementType : TypeWithAnnotations.Create(CreateErrorType());
Binder\SwitchBinder.cs (2)
431switchGoverningType = CreateErrorType(switchGoverningType.Name); 442return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(switchGoverningExpression), switchGoverningType ?? CreateErrorType());
Binder\SwitchExpressionBinder.cs (1)
198switchGoverningExpression = 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)
1173: 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)
112type = TypeWithAnnotations.Create(binder.CreateErrorType("var"));
Symbols\Source\SourceLocalSymbol.cs (3)
372declType = TypeWithAnnotations.Create(typeBinder.CreateErrorType("var")); 682return TypeWithAnnotations.Create(_nodeBinder.CreateErrorType()); 797SetTypeWithAnnotations(TypeWithAnnotations.Create(_nodeBinder.CreateErrorType("var")));
Symbols\Source\SourceMemberFieldSymbol.cs (1)
550type = TypeWithAnnotations.Create(binder.CreateErrorType("var"));