166 references to HasType
Microsoft.CodeAnalysis.CSharp (166)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22Debug.Assert(typeWithAnnotations.HasType); 41internal bool IsDefault => !_typeWithAnnotations.HasType && _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1700Debug.Assert(propertySymbol.TypeWithAnnotations.HasType);
Binder\Binder_Attributes.cs (1)
401Debug.Assert(paramType.HasType);
Binder\Binder_Conversions.cs (1)
1764Debug.Assert(elementTypeWithAnnotations.HasType);
Binder\Binder_Deconstruct.cs (5)
752Debug.Assert(isVar == !declType.HasType); 891if (declTypeWithAnnotations.HasType) 896if (declTypeWithAnnotations.HasType && 908if (declTypeWithAnnotations.HasType) 945if (declTypeWithAnnotations.HasType)
Binder\Binder_Expressions.cs (7)
941declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1050if (!elementTypeWithAnnotations.HasType) 2882Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 3132Debug.Assert(isVar != declType.HasType); 3539Debug.Assert(parameterTypeWithAnnotations.HasType); 3601Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType); 10829if (!typeArguments.All(t => t.HasType))
Binder\Binder_Patterns.cs (1)
859Debug.Assert(declType.HasType);
Binder\Binder_Statements.cs (4)
798Debug.Assert(declType.HasType || isVar); 985Debug.Assert(declTypeOpt.HasType || isVar); 1069Debug.Assert(declTypeOpt.HasType); 2823Debug.Assert(declType.HasType || isVar);
Binder\Binder_Symbols.cs (1)
526if (typeArgument.HasType && !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
68RoslynDebug.Assert(elementType.HasType, $"Field '{nameof(elementType)}' cannot be null");
Binder\ForEachLoopBinder.cs (3)
303declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 307Debug.Assert(declType.HasType); 370iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (2)
128Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || definitionParamsElementTypeOpt.HasType); 129Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || paramsElementTypeOpt.HasType);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (40)
403if (!fixedType.HasType) 450if (fixedResultType.HasType) 481return !_fixedResults[methodTypeParameterIndex].Type.HasType; 486Debug.Assert(type.HasType); 1344Debug.Assert(target.HasType); 1367if (sourceType.HasType) 1377Debug.Assert(target.HasType); 1393if (!returnType.HasType || returnType.SpecialType == SpecialType.System_Void) 1399if (!inferredReturnType.HasType) 1448if (!sourceReturnType.HasType || sourceReturnType.SpecialType == SpecialType.System_Void) 1520Debug.Assert(target.HasType); 1575Debug.Assert(target.HasType); 1610Debug.Assert(source.HasType); 1611Debug.Assert(target.HasType); 1664Debug.Assert(source.HasType); 1665Debug.Assert(target.HasType); 1679Debug.Assert(source.HasType); 1680Debug.Assert(target.HasType); 1774Debug.Assert(source.HasType); 1775Debug.Assert(target.HasType); 1803Debug.Assert(source.HasType); 1804Debug.Assert(target.HasType); 1830Debug.Assert(source.HasType); 1831Debug.Assert(target.HasType); 1941Debug.Assert(source.HasType); 1942Debug.Assert(target.HasType); 2035Debug.Assert(source.HasType); 2036Debug.Assert(target.HasType); 2104if (!elementTarget.HasType) 2450Debug.Assert(source.HasType); 2451Debug.Assert(target.HasType); 2511Debug.Assert(source.HasType); 2512Debug.Assert(target.HasType); 2525Debug.Assert(source.HasType); 2526Debug.Assert(target.HasType); 2543if (!elementSource.HasType) 2567Debug.Assert(sourceWithAnnotations.HasType); 2568Debug.Assert(targetWithAnnotations.HasType); 2807if (!best.Type.HasType) 2938if (!best.HasType)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (7)
1252expandedResult.Result.ParamsElementTypeOpt.HasType && 2567Debug.Assert(paramsElementTypeOpt.HasType); 3261if (x.HasType && Conversions.HasIdentityConversion(x.Type, y)) 3675if (!x.HasType) 3993if (!paramsIterationType.HasType) 3997Debug.Assert(paramsIterationType.HasType); 4545Debug.Assert(paramsElementTypeOpt.HasType);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1380if (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()) 616if (type.HasType) 626if (type.HasType) 732if (!returnType.HasType && inferredReturnType.NumExpressions > 0) 758if (!returnType.HasType) 827if (returnType.HasType) 865if (returnType.HasType && // Can be null if "delegateType" is not actually a delegate type. 960if (!returnType.HasType) 1204if (!returnType.HasType) 1209if (!returnType.HasType || returnType.Type.ContainsTypeParameter()) 1270if (lambda.ReturnTypeWithAnnotations.HasType) 1478return _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)
2264if (!type.HasType || 2307if (targetType.HasType && 2529if (!targetType.HasType) 3711if (targetElementType.HasType && 3727if (!targetElementType.HasType) 4259Debug.Assert(symbol.GetTypeOrReturnType().HasType); 5696bool fromExplicitCast = explicitType.HasType; 5698Debug.Assert(targetType.HasType); 6156return !type.HasType ? 7803if (!paramsIterationType.HasType) 7806Debug.Assert(paramsIterationType.HasType); 7983if (!argumentType.HasType) 8268bool fromExplicitCast = explicitType.HasType; 8270Debug.Assert(targetType.HasType); 8309if (!targetTypeOpt.HasType) 8346Debug.Assert(targetTypeOpt.HasType); 9342Debug.Assert(targetTypeWithNullability.HasType); 10448if (targetTypeOfOperandConversion.HasType) 10938Debug.Assert(targetTypeWithAnnotations.HasType);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
31Debug.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\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)
177if (!type.HasType) 192if (bestObjectConstraint.HasType) 218if (bestObjectConstraint.HasType) 545Debug.Assert(type.HasType && type.SpecialType == SpecialType.System_Object); 546if (!type.HasType)
Symbols\NamedTypeSymbol.cs (2)
1162internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1164internal 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)
509Debug.Assert(type.HasType || isVar); 552if (!type.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)