165 references to HasType
Microsoft.CodeAnalysis.CSharp (165)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22Debug.Assert(typeWithAnnotations.HasType); 41internal bool IsDefault => !_typeWithAnnotations.HasType && _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1681Debug.Assert(propertySymbol.TypeWithAnnotations.HasType);
Binder\Binder_Attributes.cs (1)
401Debug.Assert(paramType.HasType);
Binder\Binder_Conversions.cs (1)
1504Debug.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)
939declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1048if (!elementTypeWithAnnotations.HasType) 2841Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 3091Debug.Assert(isVar != declType.HasType); 3498Debug.Assert(parameterTypeWithAnnotations.HasType); 3560Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType); 10635if (!typeArguments.All(t => t.HasType))
Binder\Binder_Patterns.cs (1)
859Debug.Assert(declType.HasType);
Binder\Binder_Statements.cs (4)
797Debug.Assert(declType.HasType || isVar); 984Debug.Assert(declTypeOpt.HasType || isVar); 1068Debug.Assert(declTypeOpt.HasType); 2727Debug.Assert(declType.HasType || isVar);
Binder\Binder_Symbols.cs (1)
526if (typeArgument.HasType && !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
67Debug.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); 1657Debug.Assert(source.HasType); 1658Debug.Assert(target.HasType); 1672Debug.Assert(source.HasType); 1673Debug.Assert(target.HasType); 1718Debug.Assert(source.HasType); 1719Debug.Assert(target.HasType); 1747Debug.Assert(source.HasType); 1748Debug.Assert(target.HasType); 1774Debug.Assert(source.HasType); 1775Debug.Assert(target.HasType); 1885Debug.Assert(source.HasType); 1886Debug.Assert(target.HasType); 1972Debug.Assert(source.HasType); 1973Debug.Assert(target.HasType); 2041if (!elementTarget.HasType) 2349Debug.Assert(source.HasType); 2350Debug.Assert(target.HasType); 2410Debug.Assert(source.HasType); 2411Debug.Assert(target.HasType); 2424Debug.Assert(source.HasType); 2425Debug.Assert(target.HasType); 2442if (!elementSource.HasType) 2466Debug.Assert(sourceWithAnnotations.HasType); 2467Debug.Assert(targetWithAnnotations.HasType); 2706if (!best.Type.HasType) 2837if (!best.HasType)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (7)
1133expandedResult.Result.ParamsElementTypeOpt.HasType && 2443Debug.Assert(paramsElementTypeOpt.HasType); 2978if (x.HasType && Conversions.HasIdentityConversion(x.Type, y)) 3392if (!x.HasType) 3710if (!paramsIterationType.HasType) 3714Debug.Assert(paramsIterationType.HasType); 4249Debug.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) 826if (returnType.HasType) 864if (returnType.HasType && // Can be null if "delegateType" is not actually a delegate type. 959if (!returnType.HasType) 1203if (!returnType.HasType) 1208if (!returnType.HasType || returnType.Type.ContainsTypeParameter()) 1269if (lambda.ReturnTypeWithAnnotations.HasType) 1477return _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 (18)
2227if (!type.HasType || 2270if (targetType.HasType && 2492if (!targetType.HasType) 3639if (!elementType.HasType) 4143Debug.Assert(symbol.GetTypeOrReturnType().HasType); 5580bool fromExplicitCast = explicitType.HasType; 5582Debug.Assert(targetType.HasType); 6040return !type.HasType ? 7649if (!paramsIterationType.HasType) 7652Debug.Assert(paramsIterationType.HasType); 7829if (!argumentType.HasType) 8113bool fromExplicitCast = explicitType.HasType; 8115Debug.Assert(targetType.HasType); 8154if (!targetTypeOpt.HasType) 8191Debug.Assert(targetTypeOpt.HasType); 9176Debug.Assert(targetTypeWithNullability.HasType); 10294if (targetTypeOfOperandConversion.HasType) 10755Debug.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)
735RoslynDebug.Assert(typeWithAnnotationsOpt.HasType == (type is null)); 776if (typeWithAnnotationsOpt.HasType && typeWithAnnotationsPredicate != null) 791if (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)