-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Clause Interleaving support of LHS of extension methods #23460
t9dupuy
started this conversation in
Feature Requests
-
SIP-45 - Clause Interleaving justifies the lack of support of LHS of extension methods as follows:
The left hand side of extension methods remains unchanged, since they only have one explicit term clause, and since the type parameters are very rarely passed explicitly, it is not as necessary to have multiple type clauses there.
The following example demonstrates how such support would indeed be beneficial to the language.
trait Foo: type Type // Ok def id(using foo: Foo)[T <: foo.Type](t: T): T = t // Not ok extension (using foo: Foo)[T <: foo.Type](t: T) def id: T = t ^ '(' expected, but '[' found
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment