Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class Test { Test(String x) {} class Foo extends Test {} public static void main(String[] args) { Test x = new Test(""); Test.Foo y = x.new Foo(); } }
Actual behavior
The code compiles, but there's a runtime error
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at Test$Foo.<init>(test.groovy) at Test.main(test.groovy:8)
Expected behavior
The code should have been rejected.