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