Skip to content

Commit 7c336f9

Browse files
Rename ITypeDefinition.HasExtensionMethods to ITypeDefinition.HasExtensions
1 parent 47468ba commit 7c336f9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemLoaderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ public void ExtensionMethodTest()
14961496
Assert.That(method.IsExtensionMethod);
14971497
Assert.That(method.ReducedFrom, Is.Null);
14981498

1499-
Assert.That(type.HasExtensionMethods);
1499+
Assert.That(type.HasExtensions);
15001500
}
15011501

15021502
[Test]

ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ IEnumerable<IMethod> GetExtensionMethods(MemberLookup lookup, INamespace ns)
22152215
// TODO: maybe make this a property on INamespace?
22162216
return
22172217
from c in ns.Types
2218-
where c.IsStatic && c.HasExtensionMethods && c.TypeParameters.Count == 0 && lookup.IsAccessible(c, false)
2218+
where c.IsStatic && c.HasExtensions && c.TypeParameters.Count == 0 && lookup.IsAccessible(c, false)
22192219
from m in c.Methods
22202220
where m.IsExtensionMethod
22212221
select m;

ICSharpCode.Decompiler/TypeSystem/ITypeDefinition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public interface ITypeDefinition : ITypeDefinitionOrUnknown, IType, IEntity
7171
new IType? DeclaringType { get; } // solves ambiguity between IType.DeclaringType and IEntity.DeclaringType
7272

7373
/// <summary>
74-
/// Gets whether this type contains extension methods.
74+
/// Gets whether this type contains extension methods or C# 14 extensions.
7575
/// </summary>
76-
/// <remarks>This property is used to speed up the search for extension methods.</remarks>
77-
bool HasExtensionMethods { get; }
76+
/// <remarks>This property is used to speed up the search for extension members.</remarks>
77+
bool HasExtensions { get; }
7878

7979
/// <summary>
8080
/// The nullability specified in the [NullableContext] attribute on the type.

ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeDefinition.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sealed class MetadataTypeDefinition : ITypeDefinition
4848
public IReadOnlyList<ITypeParameter> TypeParameters { get; }
4949
public KnownTypeCode KnownTypeCode { get; }
5050
public IType EnumUnderlyingType { get; }
51-
public bool HasExtensionMethods { get; }
51+
public bool HasExtensions { get; }
5252
public Nullability NullableContext { get; }
5353

5454
// lazy-loaded:
@@ -132,7 +132,7 @@ internal MetadataTypeDefinition(MetadataModule module, TypeDefinitionHandle hand
132132
else
133133
{
134134
this.Kind = TypeKind.Class;
135-
this.HasExtensionMethods = this.IsStatic
135+
this.HasExtensions = this.IsStatic
136136
&& (module.TypeSystemOptions & TypeSystemOptions.ExtensionMethods) == TypeSystemOptions.ExtensionMethods
137137
&& td.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.Extension);
138138
}

ICSharpCode.Decompiler/TypeSystem/Implementation/MinimalCorlib.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public CorlibTypeDefinition(MinimalCorlib corlib, KnownTypeCode typeCode)
173173
IType IType.DeclaringType => null;
174174
IType IEntity.DeclaringType => null;
175175

176-
bool ITypeDefinition.HasExtensionMethods => false;
176+
bool ITypeDefinition.HasExtensions => false;
177177
bool ITypeDefinition.IsReadOnly => false;
178178

179179
TypeKind IType.Kind => typeKind;

ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext cont
4646

4747
IEnumerable<IEntity> ScanType(ITypeDefinition analyzedType, ITypeDefinition type, AnalyzerContext context)
4848
{
49-
if (!type.HasExtensionMethods)
49+
if (!type.HasExtensions)
5050
yield break;
5151

5252
if (analyzedType.ParentModule?.MetadataFile == null)

0 commit comments

Comments
 (0)