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