169 references to HasType
Microsoft.CodeAnalysis.CSharp (169)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22
Debug.Assert(typeWithAnnotations.
HasType
);
41
internal bool IsDefault => !_typeWithAnnotations.
HasType
&& _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1730
Debug.Assert(propertySymbol.TypeWithAnnotations.
HasType
);
Binder\Binder_Attributes.cs (1)
401
Debug.Assert(paramType.
HasType
);
Binder\Binder_Conversions.cs (1)
1776
Debug.Assert(elementTypeWithAnnotations.
HasType
);
Binder\Binder_Deconstruct.cs (5)
753
Debug.Assert(isVar == !declType.
HasType
);
894
if (declTypeWithAnnotations.
HasType
)
899
if (declTypeWithAnnotations.
HasType
&&
911
if (declTypeWithAnnotations.
HasType
)
948
if (declTypeWithAnnotations.
HasType
)
Binder\Binder_Expressions.cs (7)
948
declTypeWithAnnotations = declTypeWithAnnotations.
HasType
? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var"));
1057
if (!elementTypeWithAnnotations.
HasType
)
2927
Debug.Assert(targetTypeWithAnnotations.
HasType
&& targetTypeWithAnnotations.IsNullableType());
3177
Debug.Assert(isVar != declType.
HasType
);
3519
Debug.Assert(parameterTypeWithAnnotations.
HasType
);
3581
Debug.Assert(methodResult.Result.ParamsElementTypeOpt.
HasType
);
11208
if (!typeArguments.All(t => t.
HasType
))
Binder\Binder_Patterns.cs (1)
859
Debug.Assert(declType.
HasType
);
Binder\Binder_Statements.cs (4)
800
Debug.Assert(declType.
HasType
|| isVar);
987
Debug.Assert(declTypeOpt.
HasType
|| isVar);
1071
Debug.Assert(declTypeOpt.
HasType
);
2839
Debug.Assert(declType.
HasType
|| isVar);
Binder\Binder_Symbols.cs (1)
534
if (typeArgument.
HasType
&& !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
68
RoslynDebug.Assert(elementType.
HasType
, $"Field '{nameof(elementType)}' cannot be null");
Binder\ForEachLoopBinder.cs (3)
311
declType = inferredType.
HasType
? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
315
Debug.Assert(declType.
HasType
);
380
iterationVariableType = inferredType.
HasType
? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (2)
130
Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || definitionParamsElementTypeOpt.
HasType
);
131
Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || paramsElementTypeOpt.
HasType
);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (40)
418
if (!fixedType.
HasType
)
465
if (fixedResultType.
HasType
)
496
return !_fixedResults[methodTypeParameterIndex].Type.
HasType
;
501
Debug.Assert(type.
HasType
);
1369
Debug.Assert(target.
HasType
);
1392
if (sourceType.
HasType
)
1402
Debug.Assert(target.
HasType
);
1418
if (!returnType.
HasType
|| returnType.SpecialType == SpecialType.System_Void)
1424
if (!inferredReturnType.
HasType
)
1473
if (!sourceReturnType.
HasType
|| sourceReturnType.SpecialType == SpecialType.System_Void)
1547
Debug.Assert(target.
HasType
);
1602
Debug.Assert(target.
HasType
);
1637
Debug.Assert(source.
HasType
);
1638
Debug.Assert(target.
HasType
);
1691
Debug.Assert(source.
HasType
);
1692
Debug.Assert(target.
HasType
);
1706
Debug.Assert(source.
HasType
);
1707
Debug.Assert(target.
HasType
);
1801
Debug.Assert(source.
HasType
);
1802
Debug.Assert(target.
HasType
);
1830
Debug.Assert(source.
HasType
);
1831
Debug.Assert(target.
HasType
);
1857
Debug.Assert(source.
HasType
);
1858
Debug.Assert(target.
HasType
);
1968
Debug.Assert(source.
HasType
);
1969
Debug.Assert(target.
HasType
);
2062
Debug.Assert(source.
HasType
);
2063
Debug.Assert(target.
HasType
);
2131
if (!elementTarget.
HasType
)
2477
Debug.Assert(source.
HasType
);
2478
Debug.Assert(target.
HasType
);
2538
Debug.Assert(source.
HasType
);
2539
Debug.Assert(target.
HasType
);
2552
Debug.Assert(source.
HasType
);
2553
Debug.Assert(target.
HasType
);
2570
if (!elementSource.
HasType
)
2594
Debug.Assert(sourceWithAnnotations.
HasType
);
2595
Debug.Assert(targetWithAnnotations.
HasType
);
2834
if (!best.Type.
HasType
)
2965
if (!best.
HasType
)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (8)
1263
expandedResult.Result.ParamsElementTypeOpt.
HasType
&&
2597
Debug.Assert(paramsElementTypeOpt.
HasType
);
3279
if (x.
HasType
&& Conversions.HasIdentityConversion(x.Type, y))
3730
if (!x.
HasType
)
4057
if (!paramsIterationType.
HasType
)
4061
Debug.Assert(paramsIterationType.
HasType
);
4456
canInfer = !extensionTypeArguments.IsDefault && !extensionTypeArguments.Any(t => !t.
HasType
);
4704
Debug.Assert(paramsElementTypeOpt.
HasType
);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1382
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())
637
if (type.
HasType
)
647
if (type.
HasType
)
753
if (!returnType.
HasType
&& inferredReturnType.NumExpressions > 0)
779
if (!returnType.
HasType
)
848
if (returnType.
HasType
)
886
if (returnType.
HasType
&& // Can be null if "delegateType" is not actually a delegate type.
981
if (!returnType.
HasType
)
1225
if (!returnType.
HasType
)
1230
if (!returnType.
HasType
|| returnType.Type.ContainsTypeParameter())
1291
if (lambda.ReturnTypeWithAnnotations.
HasType
)
1499
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)
2347
if (!type.
HasType
||
2390
if (targetType.
HasType
&&
2612
if (!targetType.
HasType
)
3853
if (targetElementType.
HasType
&&
3869
if (!targetElementType.
HasType
)
4404
Debug.Assert(GetTypeOrReturnTypeWithAnnotations(symbol).
HasType
);
5843
bool fromExplicitCast = explicitType.
HasType
;
5845
Debug.Assert(targetType.
HasType
);
6303
return !type.
HasType
?
7964
if (!paramsIterationType.
HasType
)
7967
Debug.Assert(paramsIterationType.
HasType
);
8144
if (!argumentType.
HasType
)
8431
bool fromExplicitCast = explicitType.
HasType
;
8433
Debug.Assert(targetType.
HasType
);
8472
if (!targetTypeOpt.
HasType
)
8509
Debug.Assert(targetTypeOpt.
HasType
);
9507
Debug.Assert(targetTypeWithNullability.
HasType
);
10629
if (targetTypeOfOperandConversion.
HasType
)
11119
Debug.Assert(targetTypeWithAnnotations.
HasType
);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
33
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\Extensions\RewrittenMethodSymbol.cs (1)
53
if (iteratorElementTypeWithAnnotations.
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)
1173
internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.
HasType
;
1175
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)
519
Debug.Assert(type.
HasType
|| isVar);
562
if (!type.
HasType
)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
196
if (typeArguments.IsDefault || typeArguments.Any(t => !t.
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
)