You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2016/12/14 16:58:58 UTC
[jira] [Commented] (GROOVY-8021) Super in traits causes
MissingMethodException
[ https://issues.apache.org/jira/browse/GROOVY-8021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15748853#comment-15748853 ]
Daniil Ovchinnikov commented on GROOVY-8021:
--------------------------------------------
Possible solutions:
- prohibit {{super}} within {{@CompileStatic}} traits since there is no way now to determine the superclass in compile time.
- fail at least on static compilation of class which implements a trait referencing {{super}}, i.e. {{Foo}}
One more question arises, why I get {{MissingMethodException}} from statically compiled code?
> Super in traits causes MissingMethodException
> ---------------------------------------------
>
> Key: GROOVY-8021
> URL: https://issues.apache.org/jira/browse/GROOVY-8021
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.4.7
> Reporter: Daniil Ovchinnikov
>
> {code}
> @CompileStatic
> trait SimpleTrait {
> void foo() {
> super.foo()
> }
> }
> @CompileStatic
> class Foo implements SimpleTrait {}
> new Foo().foo() // MissingMethodException
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)