diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-19 07:32:19 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-28 15:17:06 -0800 |
commit | dbebcd509e4013ce02655a2687b27d0967b3650e (patch) | |
tree | 5401fea6b1a118dd2e0b10771fb54f94c7fdc8b3 /src/compiler | |
parent | 3bf51189f979eb0dd41744ca844fd12dfdaa0dee (diff) | |
download | scala-dbebcd509e4013ce02655a2687b27d0967b3650e.tar.gz scala-dbebcd509e4013ce02655a2687b27d0967b3650e.tar.bz2 scala-dbebcd509e4013ce02655a2687b27d0967b3650e.zip |
SI-6846, regression in type constructor inference.
In 658ba1b4e6 some inference was gained and some was lost.
In this commit we regain what was lost and gain even more.
Dealiasing and widening should be fully handled now, as
illustrated by the test case.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index a43dbae1fa..7188290688 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1122,15 +1122,17 @@ trait Infer extends Checkable { */ def inferExprInstance(tree: Tree, tparams: List[Symbol], pt: Type = WildcardType, treeTp0: Type = null, keepNothings: Boolean = true, useWeaklyCompatible: Boolean = false): List[Symbol] = { val treeTp = if(treeTp0 eq null) tree.tpe else treeTp0 // can't refer to tree in default for treeTp0 + val (targs, tvars) = exprTypeArgs(tparams, treeTp, pt, useWeaklyCompatible) printInference( ptBlock("inferExprInstance", "tree" -> tree, "tree.tpe"-> tree.tpe, "tparams" -> tparams, - "pt" -> pt + "pt" -> pt, + "targs" -> targs, + "tvars" -> tvars ) ) - val (targs, tvars) = exprTypeArgs(tparams, treeTp, pt, useWeaklyCompatible) if (keepNothings || (targs eq null)) { //@M: adjustTypeArgs fails if targs==null, neg/t0226 substExpr(tree, tparams, targs, pt) |