We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
scala> trait Bar { type Y } // defined trait Bar scala> trait Foo { type X } // defined trait Foo scala> given as Foo given (b: Bar) { type X = b.Y } 1 |given as Foo given (b: Bar) { type X = b.Y } | ^ | non-private type X in class Foo_given refers to private value b | in its type signature = Foo_given.this.b.Y scala> given as Foo given (val b: Bar) { type X = b.Y } 1 |given as Foo given (val b: Bar) { type X = b.Y } | ^^^ | an identifier expected, but 'val' found
Workaround:
scala> given as Foo given (b: Bar) = new Foo { type X = b.Y } def Foo_given given (b: Bar): Foo
I'd like to use the nicer syntax without the workaround.
The text was updated successfully, but these errors were encountered:
With updated syntax
trait Bar { type Y } trait Foo { type X } given a(using val b: Bar) as Foo { type X = b.Y }
6 |given a(using val b: Bar) as Foo { type X = b.Y } | ^^^ | an identifier expected, but 'val' found
Sorry, something went wrong.
dwijnand
Successfully merging a pull request may close this issue.
minimized code
Workaround:
expectation
I'd like to use the nicer syntax without the workaround.
The text was updated successfully, but these errors were encountered: