169 references to HasType
Microsoft.CodeAnalysis.CSharp (169)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22Debug.Assert(typeWithAnnotations.HasType); 41internal bool IsDefault => !_typeWithAnnotations.HasType && _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1730Debug.Assert(propertySymbol.TypeWithAnnotations.HasType);
Binder\Binder_Attributes.cs (1)
401Debug.Assert(paramType.HasType);
Binder\Binder_Conversions.cs (1)
1776Debug.Assert(elementTypeWithAnnotations.HasType);
Binder\Binder_Deconstruct.cs (5)
753Debug.Assert(isVar == !declType.HasType); 894if (declTypeWithAnnotations.HasType) 899if (declTypeWithAnnotations.HasType && 911if (declTypeWithAnnotations.HasType) 948if (declTypeWithAnnotations.HasType)
Binder\Binder_Expressions.cs (7)
948declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1057if (!elementTypeWithAnnotations.HasType) 2927Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 3177Debug.Assert(isVar != declType.HasType); 3519Debug.Assert(parameterTypeWithAnnotations.HasType); 3581Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType); 11208if (!typeArguments.All(t => t.HasType))
Binder\Binder_Patterns.cs (1)
859Debug.Assert(declType.HasType);
Binder\Binder_Statements.cs (4)
800Debug.Assert(declType.HasType || isVar); 987Debug.Assert(declTypeOpt.HasType || isVar); 1071Debug.Assert(declTypeOpt.HasType); 2839Debug.Assert(declType.HasType || isVar);
Binder\Binder_Symbols.cs (1)
534if (typeArgument.HasType && !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
68RoslynDebug.Assert(elementType.HasType, $"Field '{nameof(elementType)}' cannot be null");
Binder\ForEachLoopBinder.cs (3)
311declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 315Debug.Assert(declType.HasType); 380iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (2)
130Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || definitionParamsElementTypeOpt.HasType); 131Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || paramsElementTypeOpt.HasType);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (40)
418if (!fixedType.HasType) 465if (fixedResultType.HasType) 496return !_fixedResults[methodTypeParameterIndex].Type.HasType; 501Debug.Assert(type.HasType); 1369Debug.Assert(target.HasType); 1392if (sourceType.HasType) 1402Debug.Assert(target.HasType); 1418if (!returnType.HasType || returnType.SpecialType == SpecialType.System_Void) 1424if (!inferredReturnType.HasType) 1473if (!sourceReturnType.HasType || sourceReturnType.SpecialType == SpecialType.System_Void) 1547Debug.Assert(target.HasType); 1602Debug.Assert(target.HasType); 1637Debug.Assert(source.HasType); 1638Debug.Assert(target.HasType); 1691Debug.Assert(source.HasType); 1692Debug.Assert(target.HasType); 1706Debug.Assert(source.HasType); 1707Debug.Assert(target.HasType); 1801Debug.Assert(source.HasType); 1802Debug.Assert(target.HasType); 1830Debug.Assert(source.HasType); 1831Debug.Assert(target.HasType); 1857Debug.Assert(source.HasType); 1858Debug.Assert(target.HasType); 1968Debug.Assert(source.HasType); 1969Debug.Assert(target.HasType); 2062Debug.Assert(source.HasType); 2063Debug.Assert(target.HasType); 2131if (!elementTarget.HasType) 2477Debug.Assert(source.HasType); 2478Debug.Assert(target.HasType); 2538Debug.Assert(source.HasType); 2539Debug.Assert(target.HasType); 2552Debug.Assert(source.HasType); 2553Debug.Assert(target.HasType); 2570if (!elementSource.HasType) 2594Debug.Assert(sourceWithAnnotations.HasType); 2595Debug.Assert(targetWithAnnotations.HasType); 2834if (!best.Type.HasType) 2965if (!best.HasType)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (8)
1263expandedResult.Result.ParamsElementTypeOpt.HasType && 2597Debug.Assert(paramsElementTypeOpt.HasType); 3279if (x.HasType && Conversions.HasIdentityConversion(x.Type, y)) 3730if (!x.HasType) 4057if (!paramsIterationType.HasType) 4061Debug.Assert(paramsIterationType.HasType); 4456canInfer = !extensionTypeArguments.IsDefault && !extensionTypeArguments.Any(t => !t.HasType); 4704Debug.Assert(paramsElementTypeOpt.HasType);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1382if (isLastParameter && badArg.Result.ParamsElementTypeOpt.HasType)
BoundTree\BoundDiscardExpression.cs (1)
14Debug.Assert(Type is null && type.HasType);
BoundTree\ConversionGroup.cs (2)
27internal bool IsExplicitConversion => ExplicitType.HasType; 48if (ExplicitType.HasType)
BoundTree\UnboundLambda.cs (12)
323if (!bestResultType.HasType || bestResultType.IsVoidType()) 637if (type.HasType) 647if (type.HasType) 753if (!returnType.HasType && inferredReturnType.NumExpressions > 0) 779if (!returnType.HasType) 848if (returnType.HasType) 886if (returnType.HasType && // Can be null if "delegateType" is not actually a delegate type. 981if (!returnType.HasType) 1225if (!returnType.HasType) 1230if (!returnType.HasType || returnType.Type.ContainsTypeParameter()) 1291if (lambda.ReturnTypeWithAnnotations.HasType) 1499return _returnType.HasType;
BoundTree\VariablePendingInference.cs (3)
29Debug.Assert(type.HasType); 36Debug.Assert(binderOpt != null || type.HasType); 41bool inferenceFailed = !type.HasType;
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
24Debug.Assert(type.HasType);
FlowAnalysis\NullableWalker.cs (19)
2347if (!type.HasType || 2390if (targetType.HasType && 2612if (!targetType.HasType) 3853if (targetElementType.HasType && 3869if (!targetElementType.HasType) 4404Debug.Assert(GetTypeOrReturnTypeWithAnnotations(symbol).HasType); 5843bool fromExplicitCast = explicitType.HasType; 5845Debug.Assert(targetType.HasType); 6303return !type.HasType ? 7964if (!paramsIterationType.HasType) 7967Debug.Assert(paramsIterationType.HasType); 8144if (!argumentType.HasType) 8431bool fromExplicitCast = explicitType.HasType; 8433Debug.Assert(targetType.HasType); 8472if (!targetTypeOpt.HasType) 8509Debug.Assert(targetTypeOpt.HasType); 9507Debug.Assert(targetTypeWithNullability.HasType); 10629if (targetTypeOfOperandConversion.HasType) 11119Debug.Assert(targetTypeWithAnnotations.HasType);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
33Debug.Assert(type.HasType);
Symbols\AnonymousTypes\AnonymousTypeField.cs (1)
74Debug.Assert(this.Name != null && this.Location != null && this.TypeWithAnnotations.HasType);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
49Debug.Assert(fieldTypeWithAnnotations.HasType);
Symbols\ArrayTypeSymbol.cs (1)
29Debug.Assert(elementTypeWithAnnotations.HasType);
Symbols\Attributes\AttributeData.cs (1)
561if (property.TypeWithAnnotations.HasType && property.Type.SpecialType == SpecialType.System_String &&
Symbols\ConstraintsHelper.cs (1)
1634if (!bestObjectConstraint.HasType)
Symbols\Extensions\RewrittenMethodSymbol.cs (1)
53if (iteratorElementTypeWithAnnotations.HasType)
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
18Debug.Assert(typeWithAnnotations.HasType);
Symbols\Metadata\PE\NullableTypeDecoder.cs (1)
27Debug.Assert(metadataType.HasType);
Symbols\Metadata\PE\PEEventSymbol.cs (1)
91if (!_eventTypeWithAnnotations.HasType)
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
249Debug.Assert(typeWithAnnotations.HasType);
Symbols\Metadata\PE\PETypeParameterSymbol.cs (5)
178if (!type.HasType) 193if (bestObjectConstraint.HasType) 219if (bestObjectConstraint.HasType) 546Debug.Assert(type.HasType && type.SpecialType == SpecialType.System_Object); 547if (!type.HasType)
Symbols\NamedTypeSymbol.cs (2)
1173internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1175internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType();
Symbols\PointerTypeSymbol.cs (1)
28Debug.Assert(pointedAtType.HasType);
Symbols\ReducedExtensionMethodSymbol.cs (3)
178if (!typeArgsForConstraintsCheck[i].HasType) 187if (!typeArg.HasType) 230wasFullyInferred = typeArgs.All(static t => t.HasType);
Symbols\Source\GlobalExpressionVariable.cs (1)
101Debug.Assert(type.HasType || isVar);
Symbols\Source\LambdaSymbol.cs (3)
62_returnType = !returnType.HasType ? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType; 142get { return this.ReturnTypeWithAnnotations.HasType && this.ReturnType.IsVoidType(); } 161Debug.Assert(inferredReturnType.HasType);
Symbols\Source\SourceLocalSymbol.cs (2)
364if (inferredType.HasType && 375Debug.Assert(declType.HasType);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
519Debug.Assert(type.HasType || isVar); 562if (!type.HasType)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
196if (typeArguments.IsDefault || typeArguments.Any(t => !t.HasType))
Symbols\SubstitutedTypeParameterSymbol.cs (2)
116if (bestObjectConstraint.HasType) 141if (bestObjectConstraint.HasType)
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
33Debug.Assert(type.HasType);
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
23Debug.Assert(type.HasType);
Symbols\Tuples\TupleTypeSymbol.cs (1)
130Debug.Assert(newElementTypes.All(t => t.HasType));
Symbols\TypeSymbolExtensions.cs (3)
759RoslynDebug.Assert(typeWithAnnotationsOpt.HasType == (type is null)); 800if (typeWithAnnotationsOpt.HasType && typeWithAnnotationsPredicate != null) 815if (visitCustomModifiers && typeWithAnnotationsOpt.HasType)
Symbols\TypeUnification.cs (2)
81if (!t1.HasType || !t2.HasType)
Symbols\TypeWithAnnotations.cs (12)
304var str = !HasType ? "<null>" : Type.ToDisplayString(format); 309(!HasType || (!IsNullableType() && !Type.IsValueType))) 315(!HasType || (!Type.IsValueType && !Type.IsTypeParameterDisallowingAnnotationInCSharp8()))) 331internal string GetDebuggerDisplay() => !this.HasType ? "<null>" : ToDisplayString(DebuggerDisplayFormat); 345if (!HasType) 347if (other.HasType) 352else if (!other.HasType || !TypeSymbolEquals(other, comparison)) 372if (!HasType) 404if (!obj.HasType) 413if (!x.HasType) 415return !y.HasType; 771if (!HasType)