1 write to DefaultType
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithAnnotations.cs (1)
55
DefaultType
= defaultType;
33 references to DefaultType
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Constraints.cs (2)
462
if (!type.
DefaultType
.IsTypeParameter() && // Doing an explicit check for type parameter on unresolved type to avoid cycles while calculating TypeKind. An unresolved type parameter cannot resolve to a class.
515
typeWithAnnotations.
DefaultType
is TypeParameterSymbol typeParameterInConstraint && typeParameterInConstraint.ContainingSymbol == (object)typeParameter.ContainingSymbol)
Symbols\Source\GlobalExpressionVariable.cs (1)
128
var originalType = _lazyType?.Value.
DefaultType
;
Symbols\Source\SourceLocalSymbol.cs (2)
397
Debug.Assert((object)originalType?.
DefaultType
== null ||
398
originalType.Value.
DefaultType
.IsErrorType() && newType.Type.IsErrorType() ||
Symbols\Source\SourceMemberFieldSymbol.cs (1)
423
return TypeWithAnnotations.
DefaultType
.IsPointerOrFunctionPointer();
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
203
if (type.
DefaultType
is TypeParameterSymbol typeParameterSymbol && typeParameterSymbol.DeclaringMethod == (object)args.method)
Symbols\Source\SourcePropertySymbolBase.cs (1)
358
return TypeWithAnnotations.
DefaultType
.IsPointerOrFunctionPointer();
Symbols\Source\TypeParameterConstraintClause.cs (2)
170
TypeSymbol type = constraintType.IsResolved ? constraintType.Type : constraintType.
DefaultType
;
230
TypeSymbol type = constraintType.IsResolved ? constraintType.Type : constraintType.
DefaultType
;
Symbols\TypeSymbolExtensions.cs (2)
668
/// <param name="useDefaultType">If true, use <see cref="TypeWithAnnotations.
DefaultType
"/>
691
TypeSymbol current = type ?? (useDefaultType ? typeWithAnnotationsOpt.
DefaultType
: typeWithAnnotationsOpt.Type);
Symbols\TypeWithAnnotations.cs (21)
172
return new TypeWithAnnotations(defaultType: underlying.
DefaultType
, nullableAnnotation: NullableAnnotation.Annotated, Extensions.CreateLazy(compilation, underlying));
178
internal bool IsDefault =>
DefaultType
is null && this.NullableAnnotation == 0 && (_extensions == null || _extensions == Extensions.Default);
183
internal bool HasType => !(
DefaultType
is null);
246
public TypeSymbol Type => _extensions?.GetResolvedType(
DefaultType
);
247
public TypeSymbol NullableUnderlyingTypeOrSelf => _extensions.GetNullableUnderlyingTypeOrSelf(
DefaultType
);
263
public SpecialType SpecialType => _extensions.GetSpecialType(
DefaultType
);
267
_extensions.IsVoid(
DefaultType
);
269
_extensions.IsSZArray(
DefaultType
);
271
_extensions.IsRefLikeType(
DefaultType
);
273
_extensions.IsStatic(
DefaultType
);
275
_extensions.IsRestrictedType(
DefaultType
, ignoreSpanLikeTypes);
286
return
DefaultType
.ToDisplayString(format) + "?";
289
return
DefaultType
.ToDisplayString(format);
315
var declaringMethod = (
DefaultType
as TypeParameterSymbol)?.DeclaringMethod as SourceOrdinaryMethodSymbol;
528
public TypeSymbol AsTypeSymbolOnly() => _extensions.AsTypeSymbolOnly(
DefaultType
);
535
return NullableAnnotation.IsOblivious() && ((object)
DefaultType
== other) &&
768
return ReferenceEquals(
DefaultType
, other.
DefaultType
) &&
881
return CreateNonLazyType(type.
DefaultType
, type.NullableAnnotation, customModifiers);
893
return CreateNonLazyType(type.
DefaultType
, NullableAnnotation.Annotated, _customModifiers);
898
var defaultType = type.
DefaultType
;