159 references to HasType
Microsoft.CodeAnalysis.CSharp (158)
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (2)
22
Debug.Assert(typeWithAnnotations.
HasType
);
41
internal bool IsDefault => !_typeWithAnnotations.
HasType
&& _symbol is null;
Binder\Binder.ValueChecks.cs (1)
1490
Debug.Assert(propertySymbol.TypeWithAnnotations.
HasType
);
Binder\Binder_Attributes.cs (1)
390
Debug.Assert(paramType.
HasType
);
Binder\Binder_Deconstruct.cs (6)
522
if (typesWithAnnotationsBuilder.Any(t => !t.
HasType
))
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 (6)
905
declTypeWithAnnotations = declTypeWithAnnotations.
HasType
? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var"));
1014
if (!elementTypeWithAnnotations.
HasType
)
2664
Debug.Assert(targetTypeWithAnnotations.
HasType
&& targetTypeWithAnnotations.IsNullableType());
2913
Debug.Assert(isVar != declType.
HasType
);
3201
Debug.Assert(parameterTypeWithAnnotations.
HasType
);
9219
if (!typeArguments.All(t => t.
HasType
))
Binder\Binder_Patterns.cs (1)
850
Debug.Assert(declType.
HasType
);
Binder\Binder_Statements.cs (4)
801
Debug.Assert(declType.
HasType
|| isVar);
988
Debug.Assert(declTypeOpt.
HasType
|| isVar);
1072
Debug.Assert(declTypeOpt.
HasType
);
2722
Debug.Assert(declType.
HasType
|| isVar);
Binder\Binder_Symbols.cs (1)
524
if (typeArgument.
HasType
&& !ShouldCheckConstraints)
Binder\ForEachEnumeratorInfo.cs (1)
61
Debug.Assert(elementType.
HasType
, $"Field '{nameof(elementType)}' cannot be null");
Binder\ForEachLoopBinder.cs (3)
288
declType = inferredType.
HasType
? inferredType : TypeWithAnnotations.Create(CreateErrorType("var"));
292
Debug.Assert(declType.
HasType
);
348
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\MethodTypeInference.cs (40)
402
if (!fixedType.
HasType
)
449
if (fixedResultType.
HasType
)
480
return !_fixedResults[methodTypeParameterIndex].Type.
HasType
;
485
Debug.Assert(type.
HasType
);
1253
Debug.Assert(target.
HasType
);
1276
if (sourceType.
HasType
)
1286
Debug.Assert(target.
HasType
);
1302
if (!returnType.
HasType
|| returnType.SpecialType == SpecialType.System_Void)
1308
if (!inferredReturnType.
HasType
)
1357
if (!sourceReturnType.
HasType
|| sourceReturnType.SpecialType == SpecialType.System_Void)
1427
Debug.Assert(target.
HasType
);
1482
Debug.Assert(target.
HasType
);
1517
Debug.Assert(source.
HasType
);
1518
Debug.Assert(target.
HasType
);
1564
Debug.Assert(source.
HasType
);
1565
Debug.Assert(target.
HasType
);
1579
Debug.Assert(source.
HasType
);
1580
Debug.Assert(target.
HasType
);
1625
Debug.Assert(source.
HasType
);
1626
Debug.Assert(target.
HasType
);
1654
Debug.Assert(source.
HasType
);
1655
Debug.Assert(target.
HasType
);
1681
Debug.Assert(source.
HasType
);
1682
Debug.Assert(target.
HasType
);
1792
Debug.Assert(source.
HasType
);
1793
Debug.Assert(target.
HasType
);
1879
Debug.Assert(source.
HasType
);
1880
Debug.Assert(target.
HasType
);
1948
if (!elementTarget.
HasType
)
2256
Debug.Assert(source.
HasType
);
2257
Debug.Assert(target.
HasType
);
2317
Debug.Assert(source.
HasType
);
2318
Debug.Assert(target.
HasType
);
2331
Debug.Assert(source.
HasType
);
2332
Debug.Assert(target.
HasType
);
2349
if (!elementSource.
HasType
)
2373
Debug.Assert(sourceWithAnnotations.
HasType
);
2374
Debug.Assert(targetWithAnnotations.
HasType
);
2613
if (!best.Type.
HasType
)
2741
if (!best.
HasType
)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
2549
if (x.
HasType
&& Conversions.HasIdentityConversion(x.Type, y))
2974
if (!x.
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())
596
if (type.
HasType
)
606
if (type.
HasType
)
696
if (!returnType.
HasType
&& inferredReturnType.NumExpressions > 0)
720
if (!returnType.
HasType
)
787
if (returnType.
HasType
)
825
if (returnType.
HasType
&& // Can be null if "delegateType" is not actually a delegate type.
920
if (!returnType.
HasType
)
1164
if (!returnType.
HasType
)
1169
if (!returnType.
HasType
|| returnType.Type.ContainsTypeParameter())
1230
if (lambda.ReturnTypeWithAnnotations.
HasType
)
1441
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 (16)
2192
if (!type.
HasType
||
2235
if (targetType.
HasType
&&
2462
if (!targetType.
HasType
)
3859
Debug.Assert(symbol.GetTypeOrReturnType().
HasType
);
4089
if (argumentsWithAnnotations.All(argType => argType.
HasType
))
5235
bool fromExplicitCast = explicitType.
HasType
;
5237
Debug.Assert(targetType.
HasType
);
5662
return !type.
HasType
?
7153
if (!argumentType.
HasType
)
7428
bool fromExplicitCast = explicitType.
HasType
;
7430
Debug.Assert(targetType.
HasType
);
7461
if (!targetTypeOpt.
HasType
)
7498
Debug.Assert(targetTypeOpt.
HasType
);
8448
Debug.Assert(targetTypeWithNullability.
HasType
);
9564
if (targetTypeOfOperandConversion.
HasType
)
10039
Debug.Assert(targetTypeWithAnnotations.
HasType
);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (1)
30
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)
28
Debug.Assert(elementTypeWithAnnotations.
HasType
);
Symbols\Attributes\AttributeData.cs (1)
581
if (property.TypeWithAnnotations.
HasType
&& property.Type.SpecialType == SpecialType.System_String &&
Symbols\ConstraintsHelper.cs (1)
1548
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)
238
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)
1168
internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.
HasType
;
1170
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 (4)
172
if (!typeArgsForConstraintsCheck[i].
HasType
)
181
if (!typeArg.
HasType
)
223
if (typeArgs.Any(static t => !t.
HasType
))
227
(t, tp) => t.
HasType
? t : TypeWithAnnotations.Create(tp));
Symbols\Source\GlobalExpressionVariable.cs (1)
100
Debug.Assert(type.
HasType
|| isVar);
Symbols\Source\LambdaSymbol.cs (3)
60
_returnType = !returnType.
HasType
? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType;
139
get { return this.ReturnTypeWithAnnotations.
HasType
&& this.ReturnType.IsVoidType(); }
158
Debug.Assert(inferredReturnType.
HasType
);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
96
Debug.Assert(_lazyParameters.IsDefault != _lazyReturnType.
HasType
);
Symbols\Source\SourceLocalSymbol.cs (2)
365
if (inferredType.
HasType
&&
376
Debug.Assert(declType.
HasType
);
Symbols\Source\SourceMemberFieldSymbol.cs (2)
505
Debug.Assert(type.
HasType
|| isVar);
548
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)
136
Debug.Assert(newElementTypes.All(t => t.
HasType
));
Symbols\TypeSymbolExtensions.cs (3)
680
RoslynDebug.Assert(typeWithAnnotationsOpt.
HasType
== (type is null));
721
if (typeWithAnnotationsOpt.
HasType
&& typeWithAnnotationsPredicate != null)
736
if (visitCustomModifiers && typeWithAnnotationsOpt.
HasType
)
Symbols\TypeUnification.cs (2)
81
if (!t1.
HasType
|| !t2.
HasType
)
Symbols\TypeWithAnnotations.cs (12)
293
var str = !
HasType
? "<null>" : Type.ToDisplayString(format);
298
(!
HasType
|| (!IsNullableType() && !Type.IsValueType)))
304
(!
HasType
|| (!Type.IsValueType && !Type.IsTypeParameterDisallowingAnnotationInCSharp8())))
320
internal string GetDebuggerDisplay() => !this.
HasType
? "<null>" : ToDisplayString(DebuggerDisplayFormat);
334
if (!
HasType
)
336
if (other.
HasType
)
341
else if (!other.
HasType
|| !TypeSymbolEquals(other, comparison))
361
if (!
HasType
)
393
if (!obj.
HasType
)
402
if (!x.
HasType
)
404
return !y.
HasType
;
742
if (!
HasType
)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
UsesIsNullableVisitor.cs (1)
153
if (!type.
HasType
)