Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clause Interleaving support of LHS of extension methods #23460

t9dupuy started this conversation in Feature Requests
Discussion options

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
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /