Commit a1a1a4b
committed
JavaParsers: fix call to annotation methods
Previously, for tests/run/i2760/Fork.java, the parser output was:
abstract class Fork(val value: Int = ???, val warmups: Int = ???)
extends ...
Since Fork is JavaDefined, calls to `value` were translated into
field calls, but `value` is a method, not a field, so i2760 crashed at
runtime with NoSuchFieldError. We now generate instead:
abstract class Fork private[this](x$1: _root_.scala.Unit)
extends ... {
def <init>(value: Int = ???, warmups: Int = ???)
def value(): Int = 1
def warmups(): Int = 1
}
This way we get both named parameters for the constructor and real
method calls.1 parent 1420853 commit a1a1a4b
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
787 | 788 | | |
788 | 789 | | |
789 | 790 | | |
790 | | - | |
791 | | - | |
| 791 | + | |
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| |||
0 commit comments