Details

      Description

      trait T1 {
        def f: Unit
      }                                                                               
      
      trait T2 extends T1 {
        abstract override def f: Unit = "in T1"
        def something = super.f  // So the "abstract override" is needed
      }                                                                               
      
      trait Q1 {
        def f: Unit = "bippy"
      }                                                                               
      
      trait T3 extends T2 with Q1 {
        abstract override def f: Unit = "in T2"
      }
      
      object Test {
        def main(args: Array[String]): Unit = {
          new T3 { }
        }
      }
      
      % scalac29 -version
      Scala compiler version 2.9.0.r23890-b20110103193501 -- Copyright 2002-2010, LAMP/EPFL
      % scalac29 0106.scala 
      Exception in thread "main" java.lang.AssertionError: assertion failed: method f
      	at scala.Predef$$.assert(Predef.scala:99)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$scala$$tools$$nsc$$transform$$Mixin$$$$rebindSuper$$1.apply(Mixin.scala:110)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$scala$$tools$$nsc$$transform$$Mixin$$$$rebindSuper$$1.apply(Mixin.scala:95)
      	at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:96)
      	at scala.tools.nsc.transform.Mixin.scala$$tools$$nsc$$transform$$Mixin$$$$rebindSuper(Mixin.scala:95)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$mixinTraitMembers$$1$$1.apply(Mixin.scala:325)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$mixinTraitMembers$$1$$1.apply(Mixin.scala:278)
      	at scala.collection.LinearSeqOptimized$$class.foreach(LinearSeqOptimized.scala:61)
      	at scala.collection.immutable.List.foreach(List.scala:45)
      	at scala.tools.nsc.transform.Mixin.mixinTraitMembers$$1(Mixin.scala:278)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$addMixedinMembers$$3.apply(Mixin.scala
      

      Not that the version is super relevant. Even the line numbers are stable.

      % scalac26 -version
      Scala compiler version 2.6.1-final -- (c) 2002-2007 LAMP/EPFL
      % scalac26 0106.scala 
      Exception in thread "main" java.lang.AssertionError: assertion failed: method f
      	at scala.Predef$$.assert(Predef.scala:96)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$scala$$tools$$nsc$$transform$$Mixin$$$$rebindSuper$$1.apply(Mixin.scala:111)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$scala$$tools$$nsc$$transform$$Mixin$$$$rebindSuper$$1.apply(Mixin.scala:96)
      	at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:89)
      	at scala.tools.nsc.transform.Mixin.scala$$tools$$nsc$$transform$$Mixin$$$$rebindSuper(Mixin.scala:96)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$mixinTraitMembers$$1$$1.apply(Mixin.scala:257)
      	at scala.tools.nsc.transform.Mixin$$$$anonfun$$mixinTraitMembers$$1$$1.apply(Mixin.scala:224)
      

        Activity

        Hide
        A. P. Marki added a comment -

        I took a look and submitted pull request 359.

        This commit just changes the assert on a bad abstract super.m to a compiler error. Probably it's the not that simple, right? In this case, review (and rejection) is easy; but if it weren't, should I ask on scala-internals or on the jira ticket? By way of not wasting people's time? I was just looking for small bugs as an excuse to look at code.

        This is a great learning experience, but in mid-learning-curve, I don't have a lot of visibility into the code or even a feeling that I'm not doing something dumb or, worse, counter-productive.

        Needless to add, test suite passes and collaborator license agreement is verified.

        Show
        A. P. Marki added a comment - I took a look and submitted pull request 359. This commit just changes the assert on a bad abstract super.m to a compiler error. Probably it's the not that simple, right? In this case, review (and rejection) is easy; but if it weren't, should I ask on scala-internals or on the jira ticket? By way of not wasting people's time? I was just looking for small bugs as an excuse to look at code. This is a great learning experience, but in mid-learning-curve, I don't have a lot of visibility into the code or even a feeling that I'm not doing something dumb or, worse, counter-productive. Needless to add, test suite passes and collaborator license agreement is verified.
        Hide
        Paul Phillips added a comment -

        scala-internals is the best because a lot of people might respond there, and here you have a potential audience of about five. The patch looks like an improvement, except we don't use Option[Symbol]; that's what NoSymbol is for. It's in develop along with a patch from me addressing that.

        Show
        Paul Phillips added a comment - scala-internals is the best because a lot of people might respond there, and here you have a potential audience of about five. The patch looks like an improvement, except we don't use Option [Symbol] ; that's what NoSymbol is for. It's in develop along with a patch from me addressing that.
        Hide
        A. P. Marki added a comment -

        OK, thanks. I'm glad I resisted the urge to use Option.fold for the first time.

        Show
        A. P. Marki added a comment - OK, thanks. I'm glad I resisted the urge to use Option.fold for the first time.
        Hide
        A. P. Marki added a comment -

        https://github.com/scala/scala/pull/359
        72f6f0e57ca490b36cef62a3be2a8b3261476cd2

        Show
        A. P. Marki added a comment - https://github.com/scala/scala/pull/359 72f6f0e57ca490b36cef62a3be2a8b3261476cd2

          People

          • Assignee:
            A. P. Marki
            Reporter:
            Paul Phillips
            TracCC:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development