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

interface I {
  String getFoo()

trait T {

  abstract I getProp()

  def usage() {
    prop.with {
// 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() 

class Main implements T {

  I prop = { "hello" } as I

  static void main(String[] args) {
    println new Main().usage()

This message was sent by Atlassian JIRA

Reply via email to