aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2016-08-24 13:39:52 +0200
committerMartin Odersky <odersky@gmail.com>2016-09-19 11:07:43 +0200
commit07ea487704abe8969efcbb6672ce63a1748bbd73 (patch)
tree94d1746a0d7516347a955a401006d55eab89a845 /src/dotty/tools/backend/jvm/DottyBackendInterface.scala
parenta062bac8923700966a260b3f6d025221dce0b5a7 (diff)
downloaddotty-07ea487704abe8969efcbb6672ce63a1748bbd73.tar.gz
dotty-07ea487704abe8969efcbb6672ce63a1748bbd73.tar.bz2
dotty-07ea487704abe8969efcbb6672ce63a1748bbd73.zip
Fix handling of superCalls.
1. There may be calls to super on non-this. 2. there may be calls to in-dirrect super-traits.
Diffstat (limited to 'src/dotty/tools/backend/jvm/DottyBackendInterface.scala')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 30934605b..34bcd0757 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -747,9 +747,13 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
*/
def superInterfaces: List[Symbol] = {
val directlyInheritedTraits = decorateSymbol(sym).directlyInheritedTraits
+ val directlyInheritedTraitsSet = directlyInheritedTraits.toSet
val allBaseClasses = directlyInheritedTraits.iterator.flatMap(_.symbol.asClass.baseClasses.drop(1)).toSet
val superCalls = superCallsMap.getOrElse(sym, Set.empty)
- directlyInheritedTraits.filter(t => !allBaseClasses(t) || superCalls(t))
+ val additional = (superCalls -- directlyInheritedTraitsSet).filter(_.is(Flags.Trait))
+// if (additional.nonEmpty)
+// println(s"$fullName: adding supertraits $additional")
+ directlyInheritedTraits.filter(t => !allBaseClasses(t) || superCalls(t)) ++ additional
}
/**