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