1 write to DefaultType
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithAnnotations.cs (1)
55DefaultType = defaultType;
33 references to DefaultType
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Constraints.cs (2)
462if (!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. 515typeWithAnnotations.DefaultType is TypeParameterSymbol typeParameterInConstraint && typeParameterInConstraint.ContainingSymbol == (object)typeParameter.ContainingSymbol)
Symbols\Source\GlobalExpressionVariable.cs (1)
128var originalType = _lazyType?.Value.DefaultType;
Symbols\Source\SourceLocalSymbol.cs (2)
397Debug.Assert((object)originalType?.DefaultType == null || 398originalType.Value.DefaultType.IsErrorType() && newType.Type.IsErrorType() ||
Symbols\Source\SourceMemberFieldSymbol.cs (1)
423return TypeWithAnnotations.DefaultType.IsPointerOrFunctionPointer();
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
203if (type.DefaultType is TypeParameterSymbol typeParameterSymbol && typeParameterSymbol.DeclaringMethod == (object)args.method)
Symbols\Source\SourcePropertySymbolBase.cs (1)
358return TypeWithAnnotations.DefaultType.IsPointerOrFunctionPointer();
Symbols\Source\TypeParameterConstraintClause.cs (2)
170TypeSymbol type = constraintType.IsResolved ? constraintType.Type : constraintType.DefaultType; 230TypeSymbol type = constraintType.IsResolved ? constraintType.Type : constraintType.DefaultType;
Symbols\TypeSymbolExtensions.cs (2)
668/// <param name="useDefaultType">If true, use <see cref="TypeWithAnnotations.DefaultType"/> 691TypeSymbol current = type ?? (useDefaultType ? typeWithAnnotationsOpt.DefaultType : typeWithAnnotationsOpt.Type);
Symbols\TypeWithAnnotations.cs (21)
172return new TypeWithAnnotations(defaultType: underlying.DefaultType, nullableAnnotation: NullableAnnotation.Annotated, Extensions.CreateLazy(compilation, underlying)); 178internal bool IsDefault => DefaultType is null && this.NullableAnnotation == 0 && (_extensions == null || _extensions == Extensions.Default); 183internal bool HasType => !(DefaultType is null); 246public TypeSymbol Type => _extensions?.GetResolvedType(DefaultType); 247public TypeSymbol NullableUnderlyingTypeOrSelf => _extensions.GetNullableUnderlyingTypeOrSelf(DefaultType); 263public 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); 286return DefaultType.ToDisplayString(format) + "?"; 289return DefaultType.ToDisplayString(format); 315var declaringMethod = (DefaultType as TypeParameterSymbol)?.DeclaringMethod as SourceOrdinaryMethodSymbol; 528public TypeSymbol AsTypeSymbolOnly() => _extensions.AsTypeSymbolOnly(DefaultType); 535return NullableAnnotation.IsOblivious() && ((object)DefaultType == other) && 768return ReferenceEquals(DefaultType, other.DefaultType) && 881return CreateNonLazyType(type.DefaultType, type.NullableAnnotation, customModifiers); 893return CreateNonLazyType(type.DefaultType, NullableAnnotation.Annotated, _customModifiers); 898var defaultType = type.DefaultType;