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 2022/11/06 16:29:00 UTC

[jira] [Assigned] (GROOVY-9857) Immutable generates invalid super constructor call

     [ https://issues.apache.org/jira/browse/GROOVY-9857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles reassigned GROOVY-9857:
-----------------------------------

    Assignee: Eric Milles

> Immutable generates invalid super constructor call
> --------------------------------------------------
>
>                 Key: GROOVY-9857
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9857
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.7
>            Reporter: Christopher Smith
>            Assignee: Eric Milles
>            Priority: Minor
>
> The transforms invoked by {{@Immutable}} generate constructor code that unconditionally makes a call to {{super()}} even when the superclass has no default constructor.
> {code:groovy}
> @TupleConstructor(defaults = false)
> abstract class AbstractClass {
>     String a
> }
> @Immutable
> class ImmutableSubclass extends AbstractClass {
>     String i
> }
> {code}
> Compiling this pair produces {{invokespecial AbstractClass.<init>()}}, which does not exist. This should at a minimum produce a compile-time error.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)