diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-26 14:26:05 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-30 11:19:05 -0800 |
commit | d323f2f8d631404f10887d73e075e56a3fffc755 (patch) | |
tree | c2edc3e3d67b355ee717d88a189fb7ba023f0516 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | b2b59a124a2a8adf8e88c1e692c96263e0955b16 (diff) | |
download | scala-d323f2f8d631404f10887d73e075e56a3fffc755.tar.gz scala-d323f2f8d631404f10887d73e075e56a3fffc755.tar.bz2 scala-d323f2f8d631404f10887d73e075e56a3fffc755.zip |
Creator for existentials which flattens.
Currently it is possible to end up with nested existentials,
because existentialAbstraction only looks one level deeper.
This works harder to flatten them.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index f6f783516c..a4c00e9f89 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2965,7 +2965,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { error(vd.pos, "illegal abstraction from value with volatile type "+vd.symbol.tpe) val tpt1 = typedType(tree.tpt, mode) existentialTransform(tree.whereClauses map (_.symbol), tpt1.tpe)((tparams, tp) => - TypeTree(ExistentialType(tparams, tp)) setOriginal tree + TypeTree(newExistentialType(tparams, tp)) setOriginal tree ) } @@ -4134,7 +4134,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { if (isValueClass(pt.typeSymbol) || !isFullyDefined(pt)) arrayType(pt) else { val tparam = context.owner freshExistential "" setInfo TypeBounds.upper(pt) - ExistentialType(List(tparam), arrayType(tparam.tpe)) + newExistentialType(List(tparam), arrayType(tparam.tpe)) } val (expr1, baseClass) = expr0.tpe.typeSymbol match { case ArrayClass => (adapt(expr0, onlyStickyModes(mode), subArrayType(pt)), ArrayClass) |