You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2024/09/27 17:58:00 UTC
[jira] [Resolved] (GROOVY-11485) undefined default constructor of outer class causes runtime exception
[ https://issues.apache.org/jira/browse/GROOVY-11485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-11485.
----------------------------------
Fix Version/s: 5.0.0-alpha-11
Resolution: Fixed
https://github.com/apache/groovy/commit/a98c5256ab3ab62bddfc09a1ea128da722ca2447
> undefined default constructor of outer class causes runtime exception
> ---------------------------------------------------------------------
>
> Key: GROOVY-11485
> URL: https://issues.apache.org/jira/browse/GROOVY-11485
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 5.0.0-alpha-11
>
>
> I have the following program
> {code:java}
> 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();
> }
> } {code}
> h3. Actual behavior
> The code compiles, but there's a runtime error
> {code:java}
> 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) {code}
> h3. Expected behavior
> The code should have been rejected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)