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

GroovyCastException when using Trait.super.name = ... with multiple setters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1, 3.0.6
    • None
    • None

    Description

      Consider the following:

      trait T {
        def setX(Number n) {
          println 'Number'
        }
        def setX(String s) {
          println 'String'
        }
      }
      
      class C implements T {
        void test() {
          T.super.x = 'x'
        }
      }
      
      new C().test()
      

      "T.super.x = 'x'" should drive setX(String) but instead targets the Number overload and fails with GroovyCastException.

      Attachments

        Activity

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m