159 references to HasType
Microsoft.CodeAnalysis.CSharp (158)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22Debug.Assert(typeWithAnnotations.HasType); 41internal bool IsDefault => !_typeWithAnnotations.HasType && _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1490Debug.Assert(propertySymbol.TypeWithAnnotations.HasType);
Binder\Binder_Attributes.cs (1)
390Debug.Assert(paramType.HasType);
Binder\Binder_Deconstruct.cs (6)
522if (typesWithAnnotationsBuilder.Any(t => !t.HasType)) 752Debug.Assert(isVar == !declType.HasType); 891if (declTypeWithAnnotations.HasType) 896if (declTypeWithAnnotations.HasType && 908if (declTypeWithAnnotations.HasType) 945if (declTypeWithAnnotations.HasType)
Binder\Binder_Expressions.cs (6)
905declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1014if (!elementTypeWithAnnotations.HasType) 2664Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 2913Debug.Assert(isVar != declType.HasType); 3201Debug.Assert(parameterTypeWithAnnotations.HasType); 9219if (!typeArguments.All(t => t.HasType))
Binder\Binder_Patterns.cs (1)
850Debug.Assert(declType.HasType);
Binder\Binder_Statements.cs (4)
801Debug.Assert(declType.HasType || isVar); 988Debug.Assert(declTypeOpt.HasType || isVar); 1072Debug.Assert(declTypeOpt.HasType); 2722Debug.Assert(declType.HasType || isVar);
Binder\Binder_Symbols.cs (1)
524if (typeArgument.HasType && !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
61Debug.Assert(elementType.HasType, $"Field '{nameof(elementType)}' cannot be null");
Binder\ForEachLoopBinder.cs (3)
288declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 292Debug.Assert(declType.HasType); 348iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Semantics\BestTypeInferrer.cs (2)
19var example = types.FirstOrDefault(t => t.HasType); 26Debug.Assert(!type.HasType || type.Equals(example, TypeCompareKind.AllIgnoreOptions));
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (40)
402if (!fixedType.HasType) 449if (fixedResultType.HasType) 480return !_fixedResults[methodTypeParameterIndex].Type.HasType; 485Debug.Assert(type.HasType); 1253Debug.Assert(target.HasType); 1276if (sourceType.HasType) 1286Debug.Assert(target.HasType); 1302if (!returnType.HasType || returnType.SpecialType == SpecialType.System_Void) 1308if (!inferredReturnType.HasType) 1357if (!sourceReturnType.HasType || sourceReturnType.SpecialType == SpecialType.System_Void) 1427Debug.Assert(target.HasType); 1482Debug.Assert(target.HasType); 1517Debug.Assert(source.HasType); 1518Debug.Assert(target.HasType); 1564Debug.Assert(source.HasType); 1565Debug.Assert(target.HasType); 1579Debug.Assert(source.HasType); 1580Debug.Assert(target.HasType); 1625Debug.Assert(source.HasType); 1626Debug.Assert(target.HasType); 1654Debug.Assert(source.HasType); 1655Debug.Assert(target.HasType); 1681Debug.Assert(source.HasType); 1682Debug.Assert(target.HasType); 1792Debug.Assert(source.HasType); 1793Debug.Assert(target.HasType); 1879Debug.Assert(source.HasType); 1880Debug.Assert(target.HasType); 1948if (!elementTarget.HasType) 2256Debug.Assert(source.HasType); 2257Debug.Assert(target.HasType); 2317Debug.Assert(source.HasType); 2318Debug.Assert(target.HasType); 2331Debug.Assert(source.HasType); 2332Debug.Assert(target.HasType); 2349if (!elementSource.HasType) 2373Debug.Assert(sourceWithAnnotations.HasType); 2374Debug.Assert(targetWithAnnotations.HasType); 2613if (!best.Type.HasType) 2741if (!best.HasType)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
2549if (x.HasType && Conversions.HasIdentityConversion(x.Type, y)) 2974if (!x.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()) 596if (type.HasType) 606if (type.HasType) 696if (!returnType.HasType && inferredReturnType.NumExpressions > 0) 720if (!returnType.HasType) 787if (returnType.HasType) 825if (returnType.HasType && // Can be null if "delegateType" is not actually a delegate type. 920if (!returnType.HasType) 1164if (!returnType.HasType) 1169if (!returnType.HasType || returnType.Type.ContainsTypeParameter()) 1230if (lambda.ReturnTypeWithAnnotations.HasType) 1441return _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 (16)
2192if (!type.HasType || 2235if (targetType.HasType && 2462if (!targetType.HasType) 3859Debug.Assert(symbol.GetTypeOrReturnType().HasType); 4089if (argumentsWithAnnotations.All(argType => argType.HasType)) 5235bool fromExplicitCast = explicitType.HasType; 5237Debug.Assert(targetType.HasType); 5662return !type.HasType ? 7153if (!argumentType.HasType) 7428bool fromExplicitCast = explicitType.HasType; 7430Debug.Assert(targetType.HasType); 7461if (!targetTypeOpt.HasType) 7498Debug.Assert(targetTypeOpt.HasType); 8448Debug.Assert(targetTypeWithNullability.HasType); 9564if (targetTypeOfOperandConversion.HasType) 10039Debug.Assert(targetTypeWithAnnotations.HasType);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
30Debug.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)
28Debug.Assert(elementTypeWithAnnotations.HasType);
Symbols\Attributes\AttributeData.cs (1)
581if (property.TypeWithAnnotations.HasType && property.Type.SpecialType == SpecialType.System_String &&
Symbols\ConstraintsHelper.cs (1)
1548if (!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)
238Debug.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)
1168internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1170internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType();
Symbols\PointerTypeSymbol.cs (1)
28Debug.Assert(pointedAtType.HasType);
Symbols\ReducedExtensionMethodSymbol.cs (4)
172if (!typeArgsForConstraintsCheck[i].HasType) 181if (!typeArg.HasType) 223if (typeArgs.Any(static t => !t.HasType)) 227(t, tp) => t.HasType ? t : TypeWithAnnotations.Create(tp));
Symbols\Source\GlobalExpressionVariable.cs (1)
100Debug.Assert(type.HasType || isVar);
Symbols\Source\LambdaSymbol.cs (3)
60_returnType = !returnType.HasType ? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType; 139get { return this.ReturnTypeWithAnnotations.HasType && this.ReturnType.IsVoidType(); } 158Debug.Assert(inferredReturnType.HasType);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
96Debug.Assert(_lazyParameters.IsDefault != _lazyReturnType.HasType);
Symbols\Source\SourceLocalSymbol.cs (2)
365if (inferredType.HasType && 376Debug.Assert(declType.HasType);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
505Debug.Assert(type.HasType || isVar); 548if (!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)
136Debug.Assert(newElementTypes.All(t => t.HasType));
Symbols\TypeSymbolExtensions.cs (3)
680RoslynDebug.Assert(typeWithAnnotationsOpt.HasType == (type is null)); 721if (typeWithAnnotationsOpt.HasType && typeWithAnnotationsPredicate != null) 736if (visitCustomModifiers && typeWithAnnotationsOpt.HasType)
Symbols\TypeUnification.cs (2)
81if (!t1.HasType || !t2.HasType)
Symbols\TypeWithAnnotations.cs (12)
293var str = !HasType ? "<null>" : Type.ToDisplayString(format); 298(!HasType || (!IsNullableType() && !Type.IsValueType))) 304(!HasType || (!Type.IsValueType && !Type.IsTypeParameterDisallowingAnnotationInCSharp8()))) 320internal string GetDebuggerDisplay() => !this.HasType ? "<null>" : ToDisplayString(DebuggerDisplayFormat); 334if (!HasType) 336if (other.HasType) 341else if (!other.HasType || !TypeSymbolEquals(other, comparison)) 361if (!HasType) 393if (!obj.HasType) 402if (!x.HasType) 404return !y.HasType; 742if (!HasType)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
UsesIsNullableVisitor.cs (1)
153if (!type.HasType)