You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Denis Jouvin (JIRA)" <ji...@apache.org> on 2016/10/30 11:32:58 UTC

[jira] [Created] (GROOVY-7984) @SelfType does not allow trait to be added dynamically

Denis Jouvin created GROOVY-7984:
------------------------------------

             Summary: @SelfType does not allow trait to be added dynamically
                 Key: GROOVY-7984
                 URL: https://issues.apache.org/jira/browse/GROOVY-7984
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3
         Environment: windows 7, java 8, groovy script
            Reporter: Denis Jouvin


When trying to add dynamically a trait T with a SelfType type restriction on class C, to an instance of that class C, the script throws : 

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'C@92dae4' with class 'C' to class 'T'



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)