Paul King created GROOVY-8955:
---------------------------------

             Summary: VerifyError when AIC with @CS can't be detected as not 
valid
                 Key: GROOVY-8955
                 URL: https://issues.apache.org/jira/browse/GROOVY-8955
             Project: Groovy
          Issue Type: Bug
            Reporter: Paul King


In this buggy code the return type of  {{getMappedForm}} method in the AIC 
should be property. None-the-less, it shouldn't result in a {{VerifyError}}:
{code}
import groovy.transform.CompileStatic

class Property {
    String generator
}

public interface PMapping<T extends Property> {
    T getMappedForm();
}

public interface PProperty {
    PMapping getMapping();
}

@CompileStatic
class GPEntity {
    def method() {
        PProperty identity = getIdentity()
        String generatorType = 
identity.getMapping().getMappedForm().getGenerator()
    }

    PProperty getIdentity() {
        new PProperty() {
            PMapping getMapping() {
                new PMapping() {
                   def getMappedForm() {
                       new Property() {
                           String getGenerator() { 'foo' }
                       }
                   }
                }
            }
        }
    }
}

new GPEntity().method()
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to