Properly track 'abstract override' modifier. Ref #726.

This commit is contained in:
Mark Harrah 2013-04-15 14:12:15 -04:00
parent 0e7d212604
commit bef8ce05b9
7 changed files with 20 additions and 2 deletions

View File

@ -278,8 +278,10 @@ final class API(val global: CallbackGlobal) extends Compat
private def getModifiers(s: Symbol): xsbti.api.Modifiers =
{
import Flags._
new xsbti.api.Modifiers(s.hasFlag(ABSTRACT) || s.hasFlag(DEFERRED), s.hasFlag(OVERRIDE),
s.isFinal, s.hasFlag(SEALED), isImplicit(s), s.hasFlag(LAZY), hasMacro(s))
val absOver = s.hasFlag(ABSOVERRIDE)
val abs = s.hasFlag(ABSTRACT) || s.hasFlag(DEFERRED) || absOver
val over = s.hasFlag(OVERRIDE) || absOver
new xsbti.api.Modifiers(abs, over, s.isFinal, s.hasFlag(SEALED), isImplicit(s), s.hasFlag(LAZY), hasMacro(s))
}
private def isImplicit(s: Symbol) = s.hasFlag(Flags.IMPLICIT)

View File

@ -0,0 +1,3 @@
trait A {
def x: Int
}

View File

@ -0,0 +1,3 @@
trait B extends A {
override def x = 2
}

View File

@ -0,0 +1,3 @@
trait C extends A {
def x = 5
}

View File

@ -0,0 +1 @@
trait D extends C with B

View File

@ -0,0 +1,3 @@
trait C extends A {
abstract override def x = super.x + 5
}

View File

@ -0,0 +1,3 @@
> compile
$ copy-file changes/C2.scala C.scala
-> compile