New issue
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
final abstract class should not be permitted by compiler #9464
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9464?orig=1 |
@retronym said: I'm going to close this as out-of-scope, as it would still be a useful warning for most people. Our policy for this sort of thing is to encourage logging an issue (or contributing a patch) contribution to scala-abide, our nascent linting tool: https://github.com/scala/scala-abide/issues |
Jasper-M said: scala> final trait Foo
<console>:11: error: illegal combination of modifiers: abstract and final for: trait Foo
final trait Foo
^ |
@som-snytt said (edited on Jan 24, 2017 6:52:04 PM UTC): Otherwise, words here: scala/scala#5660 |
@adriaanm said: |
@som-snytt said: trait T { final def f: Unit } There is a balance to be struck between "that's stupid, you're not expressing something useful" and "OK, maybe there's a use case for that." Also, should the compiler say "that's stupid", or is that the job of the REPL or Abide? What about trait F { def f: Unit }
package impl { trait T extends F { override final def f: Unit } } where the API requires |
@adriaanm said: trait X { nope: Nothing => } // good luck We could warn under one of the nonsense-fighting flags, but not by default. |
classes which are final and abstract should not be allowed by the compiler because they are ludicrous
final abstract class Base {
}
The text was updated successfully, but these errors were encountered: