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? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding a final implicit class's equivalent definition shouldn't be possible.
trait Foo trait Implicits { final implicit class FooExtender(foo : Foo) { def empty : Unit = {} } } object Test extends Implicits { override implicit def FooExtender(foo: Foo): Test.FooExtender = super.FooExtender(foo) //should not be allowed }
Same issue as in scalc scala/bug#11078
The text was updated successfully, but these errors were encountered:
@smarter can you to point me to where the desugarimg of implicit classes takes place? I think I'll be able to fix this myself.
Sorry, something went wrong.
@soronpo I think it's https://github.com/lampepfl/dotty/blob/01c5eac2e7cf44d6fc59e87c969f7ede5abd3f2a/compiler/src/dotty/tools/dotc/ast/Desugar.scala#L582-L605 even the comment says so. The fault should be in the modifiers/flags: https://github.com/lampepfl/dotty/blob/01c5eac2e7cf44d6fc59e87c969f7ede5abd3f2a/compiler/src/dotty/tools/dotc/ast/Desugar.scala#L604.
PS: and thanks!
d4cca52
Merge pull request #5426 from Kobenko/issues/4948
74477d9
Fix #4948: final implicit class can be overridden
No branches or pull requests
Overriding a final implicit class's equivalent definition shouldn't be possible.
Same issue as in scalc scala/bug#11078
The text was updated successfully, but these errors were encountered: