Daniil Ovchinnikov created GROOVY-8049:
------------------------------------------
Summary: Trait properties with 'with'
Key: GROOVY-8049
URL: https://issues.apache.org/jira/browse/GROOVY-8049
Project: Groovy
Issue Type: Bug
Affects Versions: 2.4.7
Reporter: Daniil Ovchinnikov
{code}
@CompileStatic
interface I {
String getFoo()
}
@CompileStatic
trait T {
abstract I getProp()
def usage() {
prop.with {
foo.toUpperCase()
// Groovyc: [Static type checking] - Cannot find matching method
java.lang.Object#toUpperCase(). Please check if the declared type is right and
if the method exists.
// works when changed to getFoo().toUpperCase()
}
}
}
@CompileStatic
class Main implements T {
I prop = { "hello" } as I
static void main(String[] args) {
println new Main().usage()
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)