Scala Programming Language
  1. Scala Programming Language
  2. SI-8010

regression in trait superaccessors with overloading

    Details

      Description

      trait Base {
        def t          = 0
        def t(n: Int)  = 0
        def bt         = 0
        def bt(n: Int) = 0
      }
      trait Derived extends Base {
        override def t          = super.t
        override def t(n: Int)  = super.t(n)
        override def bt         = super.bt
        override def bt(n: Int) = super.bt(n)
      }
      
      sandbox/test.scala:11: error: double definition:
      def super$bt(n: Int): Int at line 11 and
      def super$bt(n: Int): Int at line 11
      have same type
        override def bt(n: Int) = super.bt(n)
                                        ^
      sandbox/test.scala:9: error: double definition:
      def super$t(n: Int): Int at line 9 and
      def super$t(n: Int): Int at line 9
      have same type
        override def t(n: Int)  = super.t(n)
                                        ^
      two errors found
      

      As seen in Spec2.

        Issue Links

          Activity

          Hide
          Jason Zaugg added a comment -

          Regressed in 086702d8a74d6642622c6b5bb3524bd6d9abbf7e (SI-7776 post-erasure signature clashes are now macro-aware). /cc @xeno-by

          Show
          Jason Zaugg added a comment - Regressed in 086702d8a74d6642622c6b5bb3524bd6d9abbf7e ( SI-7776 post-erasure signature clashes are now macro-aware). /cc @xeno-by
          Hide
          Jason Zaugg added a comment -

          Wow, this fixes it

          -sameTypeAfterErasure(e.sym, e1.sym)
          +sameTypeAfterErasure(e1.sym, e.sym)
          

          I'll find out why and submit a patch.

          Show
          Jason Zaugg added a comment - Wow, this fixes it -sameTypeAfterErasure(e.sym, e1.sym) +sameTypeAfterErasure(e1.sym, e.sym) I'll find out why and submit a patch.
          Hide
          Adriaan Moors added a comment -

          in the mean time i'm nominating you for bizarro bug find of the month

          Show
          Adriaan Moors added a comment - in the mean time i'm nominating you for bizarro bug find of the month
          Hide
          Jason Zaugg added a comment -
          -sameTypeAfterErasure(def bt(): Int, def bt(n: Int): Int): false
          -sameTypeAfterErasure(def t(): Int, def t(n: Int): Int): false
          +sameTypeAfterErasure(def bt(n: Int): Int, def bt(): Int): false
          +sameTypeAfterErasure(def t(n: Int): Int, def t(): Int): false
           sameTypeAfterErasure(def t(): Int, def t(n: Int): Int): false
           sameTypeAfterErasure(def bt(): Int, def bt(n: Int): Int): false
          -sameTypeAfterErasure(final def super$bt(): Int, final def super$bt(n: Int): Int): false
          -sameTypeAfterErasure(final def super$t(): Int, final def super$t(n: Int): Int): false
          -sameTypeAfterErasure(override def bt(): Int, override def bt(n: Int): Int): false
          -sameTypeAfterErasure(override def t(): Int, override def t(n: Int): Int): false
          +sameTypeAfterErasure(final def super$bt(n: Int): Int, final def super$bt(): Int): false
          +sameTypeAfterErasure(final def super$bt(n: Int): Int, final def super$bt(n: Int): Int): true
          +test/files/run/t8010.scala:12: error: double definition:
          +def super$bt(n: Int): Int at line 12 and
          +def super$bt(n: Int): Int at line 12
          +have same type
          +  override def bt(n: Int) = 1 + super.bt(n)
          +                                      ^
          +sameTypeAfterErasure(final def super$bt(): Int, final def super$bt: <error>): true
          +sameTypeAfterErasure(final def super$t(n: Int): Int, final def super$t(): Int): false
          +sameTypeAfterErasure(final def super$t(n: Int): Int, final def super$t(n: Int): Int): true
          +test/files/run/t8010.scala:10: error: double definition:
          +def super$t(n: Int): Int at line 10 and
          +def super$t(n: Int): Int at line 10
          +have same type
          +  override def t(n: Int)  = 1 + super.t(n)
          +                                      ^
          +sameTypeAfterErasure(final def super$t(): Int, final def super$t: <error>): true
          +sameTypeAfterErasure(override def bt(n: Int): Int, override def bt(): Int): false
          +sameTypeAfterErasure(override def t(n: Int): Int, override def t(): Int): false
           sameTypeAfterErasure(override def t(): Int, override def t(n: Int): Int): false
           sameTypeAfterErasure(override def t(): Int, def t(n: Int): Int): false
           sameTypeAfterErasure(override def bt(): Int, override def bt(n: Int): Int): false
          
          Show
          Jason Zaugg added a comment - -sameTypeAfterErasure(def bt(): Int, def bt(n: Int): Int): false -sameTypeAfterErasure(def t(): Int, def t(n: Int): Int): false +sameTypeAfterErasure(def bt(n: Int): Int, def bt(): Int): false +sameTypeAfterErasure(def t(n: Int): Int, def t(): Int): false sameTypeAfterErasure(def t(): Int, def t(n: Int): Int): false sameTypeAfterErasure(def bt(): Int, def bt(n: Int): Int): false -sameTypeAfterErasure(final def super$bt(): Int, final def super$bt(n: Int): Int): false -sameTypeAfterErasure(final def super$t(): Int, final def super$t(n: Int): Int): false -sameTypeAfterErasure(override def bt(): Int, override def bt(n: Int): Int): false -sameTypeAfterErasure(override def t(): Int, override def t(n: Int): Int): false +sameTypeAfterErasure(final def super$bt(n: Int): Int, final def super$bt(): Int): false +sameTypeAfterErasure(final def super$bt(n: Int): Int, final def super$bt(n: Int): Int): true +test/files/run/t8010.scala:12: error: double definition: +def super$bt(n: Int): Int at line 12 and +def super$bt(n: Int): Int at line 12 +have same type + override def bt(n: Int) = 1 + super.bt(n) + ^ +sameTypeAfterErasure(final def super$bt(): Int, final def super$bt: <error>): true +sameTypeAfterErasure(final def super$t(n: Int): Int, final def super$t(): Int): false +sameTypeAfterErasure(final def super$t(n: Int): Int, final def super$t(n: Int): Int): true +test/files/run/t8010.scala:10: error: double definition: +def super$t(n: Int): Int at line 10 and +def super$t(n: Int): Int at line 10 +have same type + override def t(n: Int) = 1 + super.t(n) + ^ +sameTypeAfterErasure(final def super$t(): Int, final def super$t: <error>): true +sameTypeAfterErasure(override def bt(n: Int): Int, override def bt(): Int): false +sameTypeAfterErasure(override def t(n: Int): Int, override def t(): Int): false sameTypeAfterErasure(override def t(): Int, override def t(n: Int): Int): false sameTypeAfterErasure(override def t(): Int, def t(n: Int): Int): false sameTypeAfterErasure(override def bt(): Int, override def bt(n: Int): Int): false
          Hide
          Jason Zaugg added a comment -
          Show
          Jason Zaugg added a comment - Corrupt Scope? Request for Elucidation: https://groups.google.com/d/msg/scala-internals/TS_KSpsLa4g/0juGQy0nAwwJ
          Hide
          Jason Zaugg added a comment -

          Adding fix-by 2.10.4 as the change that caused the regression was backported to 2.10.x

          Show
          Jason Zaugg added a comment - Adding fix-by 2.10.4 as the change that caused the regression was backported to 2.10.x
          Show
          Jason Zaugg added a comment - https://github.com/scala/scala/pull/3223 https://github.com/scala/scala/pull/3194

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Jason Zaugg
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development