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/02/05 20:37:00 UTC

[jira] [Created] (GROOVY-11307) Compiler error for misapplication of @FunctionalInterface

Eric Milles created GROOVY-11307:
------------------------------------

             Summary: Compiler error for misapplication of @FunctionalInterface
                 Key: GROOVY-11307
                 URL: https://issues.apache.org/jira/browse/GROOVY-11307
             Project: Groovy
          Issue Type: Improvement
          Components: Compiler
            Reporter: Eric Milles


{{groovyc}} does not emit errors for misuse of {{@FunctionalInterface}}.  At minimum an interface with 0 or 2+ abstract methods should be an error.  Bonus points for supporting traits as well -- a trait compiles to an interface.  And using the annotation on a class, enum or @interface is improper as well.

{code:groovy}
@FunctionalInterface
interface I {
}
{code}



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