1 write to DefaultType
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithAnnotations.cs (1)
58
DefaultType
= defaultType;
39 references to DefaultType
Microsoft.CodeAnalysis.CSharp (39)
Binder\Binder_Constraints.cs (2)
503
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.
556
typeWithAnnotations.
DefaultType
is TypeParameterSymbol typeParameterInConstraint && typeParameterInConstraint.ContainingSymbol == (object)typeParameter.ContainingSymbol)
Symbols\Source\GlobalExpressionVariable.cs (1)
129
var originalType = _lazyType?.Value.
DefaultType
;
Symbols\Source\SourceLocalSymbol.cs (2)
396
Debug.Assert((object)originalType?.
DefaultType
== null ||
397
originalType.Value.
DefaultType
.IsErrorType() && newType.Type.IsErrorType() ||
Symbols\Source\SourceMemberFieldSymbol.cs (1)
427
return TypeWithAnnotations.
DefaultType
.IsPointerOrFunctionPointer();
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
191
if (type.
DefaultType
is TypeParameterSymbol typeParameterSymbol && typeParameterSymbol.DeclaringMethod == (object)args.method)
Symbols\Source\SourcePropertySymbolBase.cs (1)
433
return TypeWithAnnotations.
DefaultType
.IsPointerOrFunctionPointer();
Symbols\Source\TypeParameterConstraintClause.cs (2)
174
TypeSymbol type = constraintType.IsResolved ? constraintType.Type : constraintType.
DefaultType
;
234
TypeSymbol type = constraintType.IsResolved ? constraintType.Type : constraintType.
DefaultType
;
Symbols\TypeSymbolExtensions.cs (2)
747
/// <param name="useDefaultType">If true, use <see cref="TypeWithAnnotations.
DefaultType
"/>
770
TypeSymbol current = type ?? (useDefaultType ? typeWithAnnotationsOpt.
DefaultType
: typeWithAnnotationsOpt.Type);
Symbols\TypeWithAnnotations.cs (27)
175
return new TypeWithAnnotations(defaultType: underlying.
DefaultType
, defaultAnnotation: NullableAnnotation.Annotated, new LazyNullableTypeParameter(compilation, underlying));
186
internal bool IsDefault =>
DefaultType
is null && this.NullableAnnotation == 0 && (_extensions == null || _extensions == Extensions.Default);
191
internal bool HasType => !(
DefaultType
is null);
254
public TypeSymbol Type => _extensions?.GetResolvedType(
DefaultType
);
256
public TypeSymbol NullableUnderlyingTypeOrSelf => _extensions.GetNullableUnderlyingTypeOrSelf(
DefaultType
);
272
public SpecialType SpecialType => _extensions.GetSpecialType(
DefaultType
);
276
_extensions.IsVoid(
DefaultType
);
278
_extensions.IsSZArray(
DefaultType
);
280
_extensions.IsRefLikeType(
DefaultType
);
282
_extensions.IsRefLikeOrAllowsRefLikeType(
DefaultType
);
284
_extensions.IsStatic(
DefaultType
);
286
_extensions.IsRestrictedType(
DefaultType
, ignoreSpanLikeTypes);
297
return
DefaultType
.ToDisplayString(format) + "?";
300
return
DefaultType
.ToDisplayString(format);
326
var declaringMethod = (
DefaultType
as TypeParameterSymbol)?.DeclaringMethod as SourceOrdinaryMethodSymbol;
512
Debug.Assert((object)newTypeWithModifiers.
DefaultType
== newTypeWithModifiers.Type);
513
return CreateLazySubstitutedType(newTypeWithModifiers.
DefaultType
, newCustomModifiers.Concat(newTypeWithModifiers.CustomModifiers), typeParameter);
556
public TypeSymbol AsTypeSymbolOnly() => _extensions.AsTypeSymbolOnly(
DefaultType
);
563
return DefaultNullableAnnotation.IsOblivious() && ((object)
DefaultType
== other) &&
797
return ReferenceEquals(
DefaultType
, other.
DefaultType
) &&
909
return CreateNonLazyType(type.
DefaultType
, type.NullableAnnotation, customModifiers);
921
return CreateNonLazyType(type.
DefaultType
, NullableAnnotation.Annotated, _customModifiers);
926
var defaultType = type.
DefaultType
;
1014
return CreateNonLazyType(type.
DefaultType
, type.NullableAnnotation, customModifiers);
1024
return CreateNonLazyType(type.
DefaultType
, NullableAnnotation.Annotated, _customModifiers);
1029
var defaultType = type.
DefaultType
;