Last active
August 29, 2015 14:05
-
-
Save robfletcher/5d9c79aec1c7bb694517 to your computer and use it in GitHub Desktop.
Is this supposed to be able to compile?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.transform.* | |
| @CompileStatic | |
| class A { | |
| private final String name | |
| A(String name) { | |
| this.name = name | |
| } | |
| } | |
| @CompileStatic | |
| class B extends A {} |
Author
I think B needs to have a constructor calling A's.
But we could probably have a better error, and especially a compilation error (at least with @cs).
Author
@glaforge Yes, that's why I'm surprised it compiles. Especially with @CompileStatic on the classes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I only get a runtime error when I try to
new B()