groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-8777) @MapConstructor with @CompileStatic: Creating inner class instance => IncompatibleClassChangeError ... does not implement the requested interface java.util.Map
Date Sun, 16 Dec 2018 13:41:00 GMT

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

Paul King resolved GROOVY-8777.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.5.5
                   3.0.0-alpha-4

> @MapConstructor with @CompileStatic: Creating inner class instance => IncompatibleClassChangeError
... does not implement the requested interface java.util.Map
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8777
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8777
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.2
>            Reporter: mgroovy
>            Assignee: Paul King
>            Priority: Minor
>             Fix For: 3.0.0-alpha-4, 2.5.5
>
>
> {code:java}
> import groovy.transform.CompileStatic
> import groovy.transform.MapConstructor
> @CompileStatic // static bug only
> class GroovyMapConstructorCheck {
>     @MapConstructor(noArg = true)
>     class Goo {
>         final int x0
>         @Override
>         public String toString() {
>             return "Goo(|$x0|)"
>         }
>     }
>     void go() {
>         println new Goo(x0:123)
>     }
> }
> final check = new GroovyMapConstructorCheck()
> check.go() 
> {code}
> throws
> {quote}
> java.lang.IncompatibleClassChangeError: Class GroovyMapConstructorCheck does not implement
the requested interface java.util.Map
> 	at GroovyMapConstructorCheck$Goo.<init>(VerifyError - Bad type on operand stack
2 v1.groovy)
> 	at GroovyMapConstructorCheck.go(VerifyError - Bad type on operand stack 2 v1.groovy:18)
> 	at GroovyMapConstructorCheck$go.call(Unknown Source)
> 	at VerifyError_-_Bad_type_on_operand_stack_2_v1.run(VerifyError - Bad type on operand
stack 2 v1.groovy:23)
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message