179 references to HasType
Microsoft.CodeAnalysis.CSharp (176)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22Debug.Assert(typeWithAnnotations.HasType); 41internal bool IsDefault => !_typeWithAnnotations.HasType && _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1959Debug.Assert(propertySymbol.TypeWithAnnotations.HasType);
Binder\Binder_Attributes.cs (1)
403Debug.Assert(paramType.HasType);
Binder\Binder_Conversions.cs (1)
1769Debug.Assert(elementTypeWithAnnotations.HasType);
Binder\Binder_Deconstruct.cs (6)
522if (typesWithAnnotationsBuilder.Any(t => !t.HasType)) 753Debug.Assert(isVar == !declType.HasType); 894if (declTypeWithAnnotations.HasType) 899if (declTypeWithAnnotations.HasType && 911if (declTypeWithAnnotations.HasType) 948if (declTypeWithAnnotations.HasType)
Binder\Binder_Expressions.cs (7)
974declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 1083if (!elementTypeWithAnnotations.HasType) 2986Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 3236Debug.Assert(isVar != declType.HasType); 3578Debug.Assert(parameterTypeWithAnnotations.HasType); 3640Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType); 11354if (!typeArguments.All(t => t.HasType))
Binder\Binder_Patterns.cs (1)
871Debug.Assert(declType.HasType);
Binder\Binder_Statements.cs (4)
805Debug.Assert(declType.HasType || isVar); 992Debug.Assert(declTypeOpt.HasType || isVar); 1076Debug.Assert(declTypeOpt.HasType); 2869Debug.Assert(declType.HasType || isVar);
Binder\Binder_Symbols.cs (1)
535if (typeArgument.HasType && !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
74RoslynDebug.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\BestTypeInferrer.cs (2)
19var example = types.FirstOrDefault(t => t.HasType); 26Debug.Assert(!type.HasType || type.Equals(example, TypeCompareKind.AllIgnoreOptions));
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)
421if (!fixedType.HasType) 468if (fixedResultType.HasType) 499return !_fixedResults[methodTypeParameterIndex].Type.HasType; 504Debug.Assert(type.HasType); 1372Debug.Assert(target.HasType); 1395if (sourceType.HasType) 1405Debug.Assert(target.HasType); 1421if (!returnType.HasType || returnType.SpecialType == SpecialType.System_Void) 1427if (!inferredReturnType.HasType) 1476if (!sourceReturnType.HasType || sourceReturnType.SpecialType == SpecialType.System_Void) 1550Debug.Assert(target.HasType); 1605Debug.Assert(target.HasType); 1640Debug.Assert(source.HasType); 1641Debug.Assert(target.HasType); 1694Debug.Assert(source.HasType); 1695Debug.Assert(target.HasType); 1709Debug.Assert(source.HasType); 1710Debug.Assert(target.HasType); 1804Debug.Assert(source.HasType); 1805Debug.Assert(target.HasType); 1833Debug.Assert(source.HasType); 1834Debug.Assert(target.HasType); 1860Debug.Assert(source.HasType); 1861Debug.Assert(target.HasType); 1971Debug.Assert(source.HasType); 1972Debug.Assert(target.HasType); 2065Debug.Assert(source.HasType); 2066Debug.Assert(target.HasType); 2134if (!elementTarget.HasType) 2480Debug.Assert(source.HasType); 2481Debug.Assert(target.HasType); 2541Debug.Assert(source.HasType); 2542Debug.Assert(target.HasType); 2555Debug.Assert(source.HasType); 2556Debug.Assert(target.HasType); 2573if (!elementSource.HasType) 2597Debug.Assert(sourceWithAnnotations.HasType); 2598Debug.Assert(targetWithAnnotations.HasType); 2837if (!best.Type.HasType) 2968if (!best.HasType)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (8)
1263expandedResult.Result.ParamsElementTypeOpt.HasType && 2579Debug.Assert(paramsElementTypeOpt.HasType); 3293if (x.HasType && Conversions.HasIdentityConversion(x.Type, y)) 3744if (!x.HasType) 4071if (!paramsIterationType.HasType) 4075Debug.Assert(paramsIterationType.HasType); 4451canInfer = !extensionTypeArguments.IsDefault && !extensionTypeArguments.Any(t => !t.HasType); 4674Debug.Assert(paramsElementTypeOpt.HasType);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1412if (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)
338if (!bestResultType.HasType || bestResultType.IsVoidType()) 655if (type.HasType) 665if (type.HasType) 774if (!returnType.HasType && inferredReturnType.NumExpressions > 0) 800if (!returnType.HasType) 870if (returnType.HasType) 908if (returnType.HasType && // Can be null if "delegateType" is not actually a delegate type. 1011if (!returnType.HasType) 1263if (!returnType.HasType) 1268if (!returnType.HasType || returnType.Type.ContainsTypeParameter()) 1330if (lambda.ReturnTypeWithAnnotations.HasType) 1542return _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 (21)
2386if (!type.HasType || 2429if (targetType.HasType && 2651if (!targetType.HasType) 3956if (targetElementType.HasType && 3978if (!targetElementType.HasType) 4050Debug.Assert(!targetElementType.HasType); 4532Debug.Assert(GetTypeOrReturnTypeWithAnnotations(symbol).HasType); 4770if (argumentsWithAnnotations.All(argType => argType.HasType)) 6028bool fromExplicitCast = explicitType.HasType; 6030Debug.Assert(targetType.HasType); 6489return !type.HasType ? 8354if (!paramsIterationType.HasType) 8357Debug.Assert(paramsIterationType.HasType); 8585if (!argumentType.HasType) 8905bool fromExplicitCast = explicitType.HasType; 8907Debug.Assert(targetType.HasType); 8946if (!targetTypeOpt.HasType) 8983Debug.Assert(targetTypeOpt.HasType); 9987Debug.Assert(targetTypeWithNullability.HasType); 11197if (targetTypeOfOperandConversion.HasType) 11782Debug.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)
30Debug.Assert(elementTypeWithAnnotations.HasType);
Symbols\Attributes\AttributeData.cs (1)
559if (property.TypeWithAnnotations.HasType && property.Type.SpecialType == SpecialType.System_String &&
Symbols\ConstraintsHelper.cs (1)
1662if (!bestObjectConstraint.HasType)
Symbols\Extensions\RewrittenMethodSymbol.cs (1)
51if (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)
1311internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1313internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType();
Symbols\PointerTypeSymbol.cs (1)
29Debug.Assert(pointedAtType.HasType);
Symbols\ReducedExtensionMethodSymbol.cs (4)
178if (!typeArgsForConstraintsCheck[i].HasType) 187if (!typeArg.HasType) 230wasFullyInferred = typeArgs.All(static t => t.HasType); 235(t, tp) => t.HasType ? t : TypeWithAnnotations.Create(tp));
Symbols\Source\GlobalExpressionVariable.cs (1)
102Debug.Assert(type.HasType || isVar);
Symbols\Source\LambdaSymbol.cs (3)
66_returnType = !returnType.HasType ? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType; 146get { return this.ReturnTypeWithAnnotations.HasType && this.ReturnType.IsVoidType(); } 170Debug.Assert(inferredReturnType.HasType);
Symbols\Source\SourceLocalSymbol.cs (2)
456if (inferredType.HasType && 467Debug.Assert(declType.HasType);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
520Debug.Assert(type.HasType || isVar); 563if (!type.HasType)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (2)
1255wasFullyInferred = typeArgs.All(static t => t.HasType); 1260(t, tp) => t.HasType ? t : TypeWithAnnotations.Create(tp));
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)
129Debug.Assert(newElementTypes.All(t => t.HasType));
Symbols\TypeSymbolExtensions.cs (3)
770RoslynDebug.Assert(typeWithAnnotationsOpt.HasType == (type is null)); 811if (typeWithAnnotationsOpt.HasType && typeWithAnnotationsPredicate != null) 826if (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)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Semantics\CollectionExpressionTests.cs (2)
6110Assert.False(elementType.HasType); 32474Assert.False(elementType.HasType);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
UsesIsNullableVisitor.cs (1)
153if (!type.HasType)