aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-04 11:39:32 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-06 16:02:42 +0100
commit380c34d70b86466b896fa3d9a3c42109e4df8b56 (patch)
tree6e25d9505d849daba1433705e7bd501aa963cfc0 /src/dotty/tools/dotc/core
parent09a87aad0449af38e2efeafb8c3770fb7d61a437 (diff)
downloaddotty-380c34d70b86466b896fa3d9a3c42109e4df8b56.tar.gz
dotty-380c34d70b86466b896fa3d9a3c42109e4df8b56.tar.bz2
dotty-380c34d70b86466b896fa3d9a3c42109e4df8b56.zip
Fix bug for reading type arguments in ClassfileParser
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala9
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala4
2 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index 46caf3116..572dc1a36 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -354,8 +354,11 @@ class TypeComparer(initctx: Context) extends DotClass {
addConstraint(tp1, tp2, fromBelow = false) && {
if ((!frozenConstraint) &&
(tp2 isRef defn.NothingClass) &&
- ctx.typerState.isGlobalCommittable)
- ctx.log(s"!!! instantiated to Nothing: $tp1, constraint = ${constraint.show}")
+ ctx.typerState.isGlobalCommittable) {
+ def msg = s"!!! instantiated to Nothing: $tp1, constraint = ${constraint.show}"
+ if (Config.flagInstantiationToNothing) assert(false, msg)
+ else ctx.log(msg)
+ }
true
}
else (ctx.mode is Mode.TypevarsMissContext) || thirdTry(tp1, tp2)
@@ -437,7 +440,7 @@ class TypeComparer(initctx: Context) extends DotClass {
ancestor2.exists && isSubType(tp1, ancestor2)
}
case _ =>
- def hasMatchingMember(name: Name): Boolean = /*>|>*/ traceIndented(s"hasMatchingMember($name) ${tp1.member(name)}") /*<|<*/ (
+ def hasMatchingMember(name: Name): Boolean = /*>|>*/ ctx.traceIndented(s"hasMatchingMember($name) ${tp1.member(name)}", subtyping) /*<|<*/ (
tp1.member(name).hasAltWith(alt => isSubType(alt.info, tp2.refinedInfo))
||
{ // special case for situations like:
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index f87d91597..5edddc396 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -268,9 +268,9 @@ class ClassfileParser(
else TypeBounds.lower(tp)
case '*' => TypeBounds.empty
}
- tp1 = RefinedType(tp, formals.head.name, bounds)
+ tp1 = RefinedType(tp1, formals.head.name, bounds)
case _ =>
- tp1 = RefinedType(tp, formals.head.name, TypeAlias(sig2type(tparams, skiptvs)))
+ tp1 = RefinedType(tp1, formals.head.name, TypeAlias(sig2type(tparams, skiptvs)))
}
formals = formals.tail
}