Skip to content

Commit d30e0df

Browse files
authored
Clarified that static extension method access cannot use E(e).staticMember (#483)
1 parent e163637 commit d30e0df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

accepted/future-releases/static-extension-methods/feature-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ The syntax looks like a constructor invocation, but it does not create a new obj
321321

322322
If `object.quickSort()` would invoke an extension method of `MyList` if `MyList` was the only extension in scope, then `MyList(object).quickSort()` will invoke the exact same method in the same way.
323323

324-
It is a compile-time error if the extension does not declare a member with the provided name. An equality check like`MyList(object) == x` is always disallowed because an extension cannot declare a member named `==`, and `MyList(object) != x` is disallowed because it's also defined in terms of a member named `==`.
324+
It is a compile-time error if the extension does not declare an instance member with the provided name. An equality check like`MyList(object) == x` is always disallowed because an extension cannot declare a member named `==`, and `MyList(object) != x` is disallowed because it's also defined in terms of a member named `==`.
325325

326326
An expression of the form `MyList(object)` or `MyList<String>(object)` must *only* be used for extension member access. It is a compile-time error to use it in any other way, similarly to how it is a compile-time error to use a *prefix* for anything other than member access. This also means that you cannot use an override expression as the receiver of a cascade, because a cascade does evaluate its receiver to a value, or of an assigning operator like `+=` or `++`. Unlike a prefix, it doesn't have to be followed by a `.` because extensions can also declare operators, but it must be followed by a `.`, a declared operator, or an arguments part (in case the extension implements `call`).
327327

0 commit comments

Comments
 (0)