Allow export of extension clause parameters #17679
adampauls
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
After this PR, it is possible to export members in extension clauses like so:
It would be nice to be able to do
This might seem a little silly, but it would be very useful for typeclass programing. With inheritance, it is nice to be able to declare an interface using a
val
ordef
on atrait
and then "implement" it with a param on acase class
. With typeclasses, you can already do a similar thing:but that extra ceremony in the extension is a little ugly. Similarly, as suggested by this thread, it would be nice to be able to call "static" methods on a typeclass (those not naturally written as
extension (self: Self) def ...
using static syntax:I think this is probably a very simple change, but I could not figure out how to do it myself.
Beta Was this translation helpful? Give feedback.
All reactions