File tree Expand file tree Collapse file tree
CSharp/Portable/Symbols/PublicModel
VisualBasic/Portable/Symbols
Tools/SemanticSearch/ReferenceAssemblies/Apis
Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,6 +156,20 @@ TypeKind ITypeSymbol.TypeKind
156156
157157 bool ITypeSymbol . IsNativeIntegerType => UnderlyingTypeSymbol . IsNativeIntegerType ;
158158
159+ #nullable enable
160+ bool ITypeSymbol . IsExtension => UnderlyingTypeSymbol is Symbols . NamedTypeSymbol { IsExtension : true } ;
161+
162+ IParameterSymbol ? ITypeSymbol . ExtensionParameter
163+ {
164+ get
165+ {
166+ return UnderlyingTypeSymbol is Symbols . NamedTypeSymbol namedType
167+ ? namedType . ExtensionParameter ? . GetPublicSymbol ( )
168+ : null ;
169+ }
170+ }
171+ #nullable disable
172+
159173 string ITypeSymbol . ToDisplayString ( CodeAnalysis . NullableFlowState topLevelNullability , SymbolDisplayFormat format )
160174 {
161175 return SymbolDisplay . ToDisplayString ( this , topLevelNullability , format ) ;
Original file line number Diff line number Diff line change @@ -1695,9 +1695,11 @@ Microsoft.CodeAnalysis.ITypeParameterSymbol.Variance.get -> Microsoft.CodeAnalys
16951695Microsoft.CodeAnalysis.ITypeSymbol
16961696Microsoft.CodeAnalysis.ITypeSymbol.AllInterfaces.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.INamedTypeSymbol!>
16971697Microsoft.CodeAnalysis.ITypeSymbol.BaseType.get -> Microsoft.CodeAnalysis.INamedTypeSymbol?
1698+ Microsoft.CodeAnalysis.ITypeSymbol.ExtensionParameter.get -> Microsoft.CodeAnalysis.IParameterSymbol?
16981699Microsoft.CodeAnalysis.ITypeSymbol.FindImplementationForInterfaceMember(Microsoft.CodeAnalysis.ISymbol! interfaceMember) -> Microsoft.CodeAnalysis.ISymbol?
16991700Microsoft.CodeAnalysis.ITypeSymbol.Interfaces.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.INamedTypeSymbol!>
17001701Microsoft.CodeAnalysis.ITypeSymbol.IsAnonymousType.get -> bool
1702+ Microsoft.CodeAnalysis.ITypeSymbol.IsExtension.get -> bool
17011703Microsoft.CodeAnalysis.ITypeSymbol.IsNativeIntegerType.get -> bool
17021704Microsoft.CodeAnalysis.ITypeSymbol.IsReadOnly.get -> bool
17031705Microsoft.CodeAnalysis.ITypeSymbol.IsRecord.get -> bool
Original file line number Diff line number Diff line change @@ -202,13 +202,13 @@ public interface INamedTypeSymbol : ITypeSymbol
202202 /// Is this a symbol for an extension declaration.
203203 /// </summary>
204204 [ MemberNotNullWhen ( true , nameof ( ExtensionGroupingName ) , nameof ( ExtensionMarkerName ) ) ]
205- bool IsExtension { get ; }
205+ new bool IsExtension { get ; }
206206
207207 /// <summary>
208208 /// The extension parameter if this is an extension declaration (<see cref="IsExtension"/> is true).
209209 /// Note: this may be null even if <see cref="IsExtension"/> is true, in error cases.
210210 /// </summary>
211- IParameterSymbol ? ExtensionParameter { get ; }
211+ new IParameterSymbol ? ExtensionParameter { get ; }
212212
213213 /// <summary>
214214 /// For extensions, returns the synthesized identifier for the grouping type.
Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ public interface ITypeSymbol : INamespaceOrTypeSymbol
8080 /// </summary>
8181 bool IsNativeIntegerType { get ; }
8282
83+ [ Obsolete ( $ "This API will be removed in the future. Use { nameof ( INamedTypeSymbol ) } .{ nameof ( INamedTypeSymbol . IsExtension ) } instead.") ]
84+ bool IsExtension { get ; }
85+
86+ [ Obsolete ( $ "This API will be removed in the future. Use { nameof ( INamedTypeSymbol ) } .{ nameof ( INamedTypeSymbol . ExtensionParameter ) } instead.") ]
87+ IParameterSymbol ? ExtensionParameter { get ; }
88+
8389 /// <summary>
8490 /// The original definition of this symbol. If this symbol is constructed from another
8591 /// symbol by type substitution then <see cref="OriginalDefinition"/> gets the original symbol as it was defined in
Original file line number Diff line number Diff line change @@ -782,5 +782,19 @@ Done:
782782 Private Function ITypeSymbolInternal_GetITypeSymbol() As ITypeSymbol Implements ITypeSymbolInternal.GetITypeSymbol
783783 Return Me
784784 End Function
785+
786+ <Obsolete>
787+ Private ReadOnly Property ITypeSymbol_IsExtension As Boolean Implements ITypeSymbol.IsExtension
788+ Get
789+ Return False
790+ End Get
791+ End Property
792+
793+ <Obsolete>
794+ Private ReadOnly Property ITypeSymbol_ExtensionParameter As IParameterSymbol Implements ITypeSymbol.ExtensionParameter
795+ Get
796+ Return Nothing
797+ End Get
798+ End Property
785799 End Class
786800End Namespace
Original file line number Diff line number Diff line change @@ -1480,8 +1480,10 @@ Microsoft.CodeAnalysis.ITypeSymbol.ToMinimalDisplayString(Microsoft.CodeAnalysis
14801480Microsoft.CodeAnalysis.ITypeSymbol.WithNullableAnnotation(Microsoft.CodeAnalysis.NullableAnnotation)
14811481Microsoft.CodeAnalysis.ITypeSymbol.get_AllInterfaces
14821482Microsoft.CodeAnalysis.ITypeSymbol.get_BaseType
1483+ Microsoft.CodeAnalysis.ITypeSymbol.get_ExtensionParameter
14831484Microsoft.CodeAnalysis.ITypeSymbol.get_Interfaces
14841485Microsoft.CodeAnalysis.ITypeSymbol.get_IsAnonymousType
1486+ Microsoft.CodeAnalysis.ITypeSymbol.get_IsExtension
14851487Microsoft.CodeAnalysis.ITypeSymbol.get_IsNativeIntegerType
14861488Microsoft.CodeAnalysis.ITypeSymbol.get_IsReadOnly
14871489Microsoft.CodeAnalysis.ITypeSymbol.get_IsRecord
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ public ImmutableArray<INamedTypeSymbol> AllInterfaces
4242
4343 public bool IsNativeIntegerType => false ;
4444
45+ #if ! ROSLYN_4_12_OR_LOWER
46+ bool ITypeSymbol . IsExtension => false ;
47+
48+ IParameterSymbol ITypeSymbol . ExtensionParameter => null ;
49+ #endif
50+
4551 public static ImmutableArray < ITypeSymbol > TupleElementTypes => default ;
4652
4753 public static ImmutableArray < string > TupleElementNames => default ;
You can’t perform that action at this time.
0 commit comments