166 references to HasType
Microsoft.CodeAnalysis.CSharp (166)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22
Debug.Assert(typeWithAnnotations.
HasType
);
41
internal bool IsDefault => !_typeWithAnnotations.
HasType
&& _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1700
Debug.Assert(propertySymbol.TypeWithAnnotations.
HasType
);
Binder\Binder_Attributes.cs (1)
401
Debug.Assert(paramType.
HasType
);
Binder\Binder_Conversions.cs (1)
1764
Debug.Assert(elementTypeWithAnnotations.
HasType
);
Binder\Binder_Deconstruct.cs (5)
752
Debug.Assert(isVar == !declType.
HasType
);
891
if (declTypeWithAnnotations.
HasType
)
896
if (declTypeWithAnnotations.
HasType
&&
908
if (declTypeWithAnnotations.
HasType
)
945
if (declTypeWithAnnotations.
HasType
)
Binder\Binder_Expressions.cs (7)
941
declTypeWithAnnotations = declTypeWithAnnotations.
HasType
? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var"));
1050
if (!elementTypeWithAnnotations.
HasType
)
2882
Debug.Assert(targetTypeWithAnnotations.
HasType
&& targetTypeWithAnnotations.IsNullableType());
3132
Debug.Assert(isVar != declType.
HasType
);
3539
Debug.Assert(parameterTypeWithAnnotations.
HasType
);
3601
Debug.Assert(methodResult.Result.ParamsElementTypeOpt.
HasType
);
10827
if (!typeArguments.All(t => t.
HasType
))
Binder\Binder_Patterns.cs (1)
859
Debug.Assert(declType.
HasType
);
Binder\Binder_Statements.cs (4)
798
Debug.Assert(declType.
HasType
|| isVar);
985
Debug.Assert(declTypeOpt.
HasType
|| isVar);
1069
Debug.Assert(declTypeOpt.
HasType
);
2823
Debug.Assert(declType.
HasType
|| isVar);
Binder\Binder_Symbols.cs (1)
526
if (typeArgument.
HasType
&& !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
68
RoslynDebug.Assert(elementType.
HasType
, $"Field '{nameof(elementType)}' cannot be null");
Binder\ForEachLoopBinder.cs (3)
303
declType = inferredType.
HasType
? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
307
Debug.Assert(declType.
HasType
);
370
iterationVariableType = inferredType.
HasType
? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (2)
128
Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || definitionParamsElementTypeOpt.
HasType
);
129
Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || paramsElementTypeOpt.
HasType
);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (40)
403
if (!fixedType.
HasType
)
450
if (fixedResultType.
HasType
)
481
return !_fixedResults[methodTypeParameterIndex].Type.
HasType
;
486
Debug.Assert(type.
HasType
);
1344
Debug.Assert(target.
HasType
);
1367
if (sourceType.
HasType
)
1377
Debug.Assert(target.
HasType
);
1393
if (!returnType.
HasType
|| returnType.SpecialType == SpecialType.System_Void)
1399
if (!inferredReturnType.
HasType
)
1448
if (!sourceReturnType.
HasType
|| sourceReturnType.SpecialType == SpecialType.System_Void)
1520
Debug.Assert(target.
HasType
);
1575
Debug.Assert(target.
HasType
);
1610
Debug.Assert(source.
HasType
);
1611
Debug.Assert(target.
HasType
);
1664
Debug.Assert(source.
HasType
);
1665
Debug.Assert(target.
HasType
);
1679
Debug.Assert(source.
HasType
);
1680
Debug.Assert(target.
HasType
);
1774
Debug.Assert(source.
HasType
);
1775
Debug.Assert(target.
HasType
);
1803
Debug.Assert(source.
HasType
);
1804
Debug.Assert(target.
HasType
);
1830
Debug.Assert(source.
HasType
);
1831
Debug.Assert(target.
HasType
);
1941
Debug.Assert(source.
HasType
);
1942
Debug.Assert(target.
HasType
);
2035
Debug.Assert(source.
HasType
);
2036
Debug.Assert(target.
HasType
);
2104
if (!elementTarget.
HasType
)
2450
Debug.Assert(source.
HasType
);
2451
Debug.Assert(target.
HasType
);
2511
Debug.Assert(source.
HasType
);
2512
Debug.Assert(target.
HasType
);
2525
Debug.Assert(source.
HasType
);
2526
Debug.Assert(target.
HasType
);
2543
if (!elementSource.
HasType
)
2567
Debug.Assert(sourceWithAnnotations.
HasType
);
2568
Debug.Assert(targetWithAnnotations.
HasType
);
2807
if (!best.Type.
HasType
)
2938
if (!best.
HasType
)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (7)
1252
expandedResult.Result.ParamsElementTypeOpt.
HasType
&&
2567
Debug.Assert(paramsElementTypeOpt.
HasType
);
3261
if (x.
HasType
&& Conversions.HasIdentityConversion(x.Type, y))
3675
if (!x.
HasType
)
3993
if (!paramsIterationType.
HasType
)
3997
Debug.Assert(paramsIterationType.
HasType
);
4545
Debug.Assert(paramsElementTypeOpt.
HasType
);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1380
if (isLastParameter && badArg.Result.ParamsElementTypeOpt.
HasType
)
BoundTree\BoundDiscardExpression.cs (1)
14
Debug.Assert(Type is null && type.
HasType
);
BoundTree\ConversionGroup.cs (2)
27
internal bool IsExplicitConversion => ExplicitType.
HasType
;
48
if (ExplicitType.
HasType
)
BoundTree\UnboundLambda.cs (12)
323
if (!bestResultType.
HasType
|| bestResultType.IsVoidType())
616
if (type.
HasType
)
626
if (type.
HasType
)
732
if (!returnType.
HasType
&& inferredReturnType.NumExpressions > 0)
758
if (!returnType.
HasType
)
827
if (returnType.
HasType
)
865
if (returnType.
HasType
&& // Can be null if "delegateType" is not actually a delegate type.
960
if (!returnType.
HasType
)
1204
if (!returnType.
HasType
)
1209
if (!returnType.
HasType
|| returnType.Type.ContainsTypeParameter())
1270
if (lambda.ReturnTypeWithAnnotations.
HasType
)
1478
return _returnType.
HasType
;
BoundTree\VariablePendingInference.cs (3)
29
Debug.Assert(type.
HasType
);
36
Debug.Assert(binderOpt != null || type.
HasType
);
41
bool inferenceFailed = !type.
HasType
;
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
24
Debug.Assert(type.
HasType
);
FlowAnalysis\NullableWalker.cs (19)
2325
if (!type.
HasType
||
2368
if (targetType.
HasType
&&
2590
if (!targetType.
HasType
)
3772
if (targetElementType.
HasType
&&
3788
if (!targetElementType.
HasType
)
4320
Debug.Assert(symbol.GetTypeOrReturnType().
HasType
);
5757
bool fromExplicitCast = explicitType.
HasType
;
5759
Debug.Assert(targetType.
HasType
);
6217
return !type.
HasType
?
7864
if (!paramsIterationType.
HasType
)
7867
Debug.Assert(paramsIterationType.
HasType
);
8044
if (!argumentType.
HasType
)
8329
bool fromExplicitCast = explicitType.
HasType
;
8331
Debug.Assert(targetType.
HasType
);
8370
if (!targetTypeOpt.
HasType
)
8407
Debug.Assert(targetTypeOpt.
HasType
);
9403
Debug.Assert(targetTypeWithNullability.
HasType
);
10509
if (targetTypeOfOperandConversion.
HasType
)
10999
Debug.Assert(targetTypeWithAnnotations.
HasType
);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
31
Debug.Assert(type.
HasType
);
Symbols\AnonymousTypes\AnonymousTypeField.cs (1)
74
Debug.Assert(this.Name != null && this.Location != null && this.TypeWithAnnotations.
HasType
);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (1)
49
Debug.Assert(fieldTypeWithAnnotations.
HasType
);
Symbols\ArrayTypeSymbol.cs (1)
29
Debug.Assert(elementTypeWithAnnotations.
HasType
);
Symbols\Attributes\AttributeData.cs (1)
561
if (property.TypeWithAnnotations.
HasType
&& property.Type.SpecialType == SpecialType.System_String &&
Symbols\ConstraintsHelper.cs (1)
1634
if (!bestObjectConstraint.
HasType
)
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
18
Debug.Assert(typeWithAnnotations.
HasType
);
Symbols\Metadata\PE\NullableTypeDecoder.cs (1)
27
Debug.Assert(metadataType.
HasType
);
Symbols\Metadata\PE\PEEventSymbol.cs (1)
91
if (!_eventTypeWithAnnotations.
HasType
)
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
249
Debug.Assert(typeWithAnnotations.
HasType
);
Symbols\Metadata\PE\PETypeParameterSymbol.cs (5)
178
if (!type.
HasType
)
193
if (bestObjectConstraint.
HasType
)
219
if (bestObjectConstraint.
HasType
)
546
Debug.Assert(type.
HasType
&& type.SpecialType == SpecialType.System_Object);
547
if (!type.
HasType
)
Symbols\NamedTypeSymbol.cs (2)
1157
internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.
HasType
;
1159
internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.
HasType
&& type.Type.IsErrorType();
Symbols\PointerTypeSymbol.cs (1)
28
Debug.Assert(pointedAtType.
HasType
);
Symbols\ReducedExtensionMethodSymbol.cs (3)
178
if (!typeArgsForConstraintsCheck[i].
HasType
)
187
if (!typeArg.
HasType
)
230
wasFullyInferred = typeArgs.All(static t => t.
HasType
);
Symbols\Source\GlobalExpressionVariable.cs (1)
101
Debug.Assert(type.
HasType
|| isVar);
Symbols\Source\LambdaSymbol.cs (3)
62
_returnType = !returnType.
HasType
? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType;
142
get { return this.ReturnTypeWithAnnotations.
HasType
&& this.ReturnType.IsVoidType(); }
161
Debug.Assert(inferredReturnType.
HasType
);
Symbols\Source\SourceLocalSymbol.cs (2)
364
if (inferredType.
HasType
&&
375
Debug.Assert(declType.
HasType
);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
509
Debug.Assert(type.
HasType
|| isVar);
552
if (!type.
HasType
)
Symbols\SubstitutedTypeParameterSymbol.cs (2)
116
if (bestObjectConstraint.
HasType
)
141
if (bestObjectConstraint.
HasType
)
Symbols\Synthesized\SynthesizedParameterSymbol.cs (1)
33
Debug.Assert(type.
HasType
);
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
23
Debug.Assert(type.
HasType
);
Symbols\Tuples\TupleTypeSymbol.cs (1)
130
Debug.Assert(newElementTypes.All(t => t.
HasType
));
Symbols\TypeSymbolExtensions.cs (3)
759
RoslynDebug.Assert(typeWithAnnotationsOpt.
HasType
== (type is null));
800
if (typeWithAnnotationsOpt.
HasType
&& typeWithAnnotationsPredicate != null)
815
if (visitCustomModifiers && typeWithAnnotationsOpt.
HasType
)
Symbols\TypeUnification.cs (2)
81
if (!t1.
HasType
|| !t2.
HasType
)
Symbols\TypeWithAnnotations.cs (12)
304
var str = !
HasType
? "<null>" : Type.ToDisplayString(format);
309
(!
HasType
|| (!IsNullableType() && !Type.IsValueType)))
315
(!
HasType
|| (!Type.IsValueType && !Type.IsTypeParameterDisallowingAnnotationInCSharp8())))
331
internal string GetDebuggerDisplay() => !this.
HasType
? "<null>" : ToDisplayString(DebuggerDisplayFormat);
345
if (!
HasType
)
347
if (other.
HasType
)
352
else if (!other.
HasType
|| !TypeSymbolEquals(other, comparison))
372
if (!
HasType
)
404
if (!obj.
HasType
)
413
if (!x.
HasType
)
415
return !y.
HasType
;
771
if (!
HasType
)