[ https://issues.apache.org/jira/browse/GROOVY-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Allen Arakaki updated GROOVY-7416: ---------------------------------- Attachment: abstractcompilestatic.zip > Problem With CompileStatic And Interface Methods In Abstract Subclass > --------------------------------------------------------------------- > > Key: GROOVY-7416 > URL: https://issues.apache.org/jira/browse/GROOVY-7416 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 2.4.3 > Reporter: Jeff Scott Brown > Attachments: abstractcompilestatic.zip, abstractcompilestatic.zip, > abstractcompilestatic.zip, abstractcompilestatic.zip > > > The attached abstractcompilestatic.zip contains the following: > {code:borderStyle=solid|title=src/main/groovy/demo/SomeInterface.groovy} > package demo > interface SomeInterface { > void someInterfaceMethod() > } > {code} > {code:borderStyle=solid|title=src/main/groovy/demo/AbstractSuperClass.groovy} > package demo > abstract class AbstractSuperClass implements SomeInterface {} > {code} > {code:borderStyle=solid|title=src/main/groovy/demo/AbstractSubClass.groovy} > package demo > import groovy.transform.CompileStatic > @CompileStatic > abstract class AbstractSubClass extends AbstractSuperClass { > void someMethod() { > someInterfaceMethod() > } > } > {code} > The code will not compile. > {noformat} > $ ./gradlew clean compileGroovy > :clean > :compileJava UP-TO-DATE > :compileGroovy > startup failed: > /Users/jeff/abstractcompilestatic/src/main/groovy/demo/AbstractSubClass.groovy: > 9: [Static type checking] - Cannot find matching method > demo.AbstractSubClass#someInterfaceMethod(). Please check if the declared > type is right and if the method exists. > @ line 9, column 9. > someInterfaceMethod() > ^ > 1 error > :compileGroovy FAILED > FAILURE: Build failed with an exception. > * What went wrong: > Execution failed for task ':compileGroovy'. > > Compilation failed; see the compiler error output for details. > * Try: > Run with --stacktrace option to get the stack trace. Run with --info or > --debug option to get more log output. > BUILD FAILED > Total time: 4.045 secs > {noformat} > If the AbstractSubClass is modified to implement the interface as shown below > the code will compile: > {code:borderStyle=solid|title=src/main/groovy/demo/AbstractSubClass.groovy} > package demo > import groovy.transform.CompileStatic > @CompileStatic > abstract class AbstractSubClass extends AbstractSuperClass implements > SomeInterface { > void someMethod() { > someInterfaceMethod() > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)