Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7984

@SelfType does not allow trait to be added dynamically

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7
    • 5.0.0-alpha-6
    • Compiler
    • windows 7, java 8, groovy script

    Description

      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'

      Attachments

        Activity

          People

            emilles Eric Milles
            djouvin Denis Jouvin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: