aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-02-18 15:47:21 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-11 14:43:06 +0100
commitab24bcf84d64e5d6fa2201056f70fe38a3260cc1 (patch)
treefbda5feb4a976d708bc912f5591c2f7c146c2708 /src/dotty/tools/backend/jvm/DottyBackendInterface.scala
parent65dee79159daddd987eee0e5363d00d662e611e1 (diff)
downloaddotty-ab24bcf84d64e5d6fa2201056f70fe38a3260cc1.tar.gz
dotty-ab24bcf84d64e5d6fa2201056f70fe38a3260cc1.tar.bz2
dotty-ab24bcf84d64e5d6fa2201056f70fe38a3260cc1.zip
Workaround #371 module classes read from byte code have no syperclass
Diffstat (limited to 'src/dotty/tools/backend/jvm/DottyBackendInterface.scala')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 651c5d736..ffb6a0377 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -490,7 +490,17 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
}
}
def parentSymbols: List[Symbol] = toDenot(sym).info.parents.map(_.typeSymbol)
- def superClass: Symbol = toDenot(sym).superClass
+ def superClass: Symbol = {
+ val t = toDenot(sym).superClass
+ if (t.exists) t
+ else if (sym is Flags.ModuleClass) {
+ // workaround #371
+
+ println(s"Warning: mocking up superclass for $sym")
+ ObjectClass
+ }
+ else t
+ }
def enclClass: Symbol = toDenot(sym).enclosingClass
def linkedClassOfClass: Symbol = linkedClass
def linkedClass: Symbol = {