aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-23 12:29:53 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-23 12:29:53 +0200
commit918c190c91a27212caf2152f9a65533f9dff395d (patch)
treeb49833bd9a8c2d584be9c9d3e52c666d096c4ec8 /src
parent2a8abfa8da9742e0a8b5460c6032d7ef610e44ab (diff)
downloaddotty-918c190c91a27212caf2152f9a65533f9dff395d.tar.gz
dotty-918c190c91a27212caf2152f9a65533f9dff395d.tar.bz2
dotty-918c190c91a27212caf2152f9a65533f9dff395d.zip
Fixed a bug related to classfile parsing
Parsing inner classes of generic outer classes requires a name-unexpansion.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala3
-rw-r--r--src/dotty/tools/dotc/printing/PlainPrinter.scala7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index 344508c11..fc3fb49ec 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -140,7 +140,7 @@ class ClassfileParser(
var sym = classRoot.owner
while (sym.isClass && !(sym is Flags.ModuleClass)) {
for (tparam <- sym.typeParams) {
- classTParams = classTParams.updated(tparam.name, tparam)
+ classTParams = classTParams.updated(tparam.name.unexpandedName(), tparam)
}
sym = sym.owner
}
@@ -304,6 +304,7 @@ class ClassfileParser(
case 'T' =>
val n = subName(';'.==).toTypeName
index += 1
+ //assert(tparams contains n, s"classTparams = $classTParams, tparams = $tparams, key = $n")
if (skiptvs) defn.AnyType else tparams(n).typeConstructor
}
} // sig2type(tparams, skiptvs)
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala
index 6e81d5558..8780f60e6 100644
--- a/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -161,7 +161,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
protected def idString(sym: Symbol): String =
if (ctx.settings.uniqid.value) "#" + sym.id else ""
- def nameString(sym: Symbol): String = simpleNameString(sym) + idString(sym)
+ def nameString(sym: Symbol): String =
+ simpleNameString(sym) + idString(sym) // + "<" + (if (sym.exists) sym.owner else "") + ">"
def fullNameString(sym: Symbol): String =
if (sym.isRoot || sym == NoSymbol || sym.owner.isEffectiveRoot)
@@ -312,7 +313,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
else nameString(sym)
}).close
- def locationText(sym: Symbol): Text = {
+ def locationText(sym: Symbol): Text =
+ if (!sym.exists) ""
+ else {
val owns = sym.effectiveOwner
if (owns.isClass && !isEmptyPrefix(owns)) " in " ~ toText(owns) else Text()
}