diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-23 17:47:24 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-23 18:27:58 +0100 |
commit | d38109dad5527e0e54d8296c6a3542a345ab947f (patch) | |
tree | 7c16a14e8c83430875a29bcb467fdfe64f7c6b46 /src | |
parent | 0b565c0a808ba6213a41f82b318285855c6836f0 (diff) | |
download | scala-d38109dad5527e0e54d8296c6a3542a345ab947f.tar.gz scala-d38109dad5527e0e54d8296c6a3542a345ab947f.tar.bz2 scala-d38109dad5527e0e54d8296c6a3542a345ab947f.zip |
further tweaking packing magic
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 47d5107f18..505d7c85a1 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2147,9 +2147,9 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { val selector1 = checkDead(typed(selector, EXPRmode | BYVALmode, WildcardType)) val selectorTp = packCaptured(selector1.tpe.widen) val casesTyped = typedCases(cases, selectorTp, resTp) - val caseTypes = casesTyped map (_.tpe.deconst) //map (c => packedType(c, context.owner).deconst) - val (ownType, needAdapt) = if (isFullyDefined(resTp)) (resTp, false) else weakLub(caseTypes) - // val ownType = ownType0.skolemizeExistential(context.owner, context.tree) + val caseTypes = casesTyped map (c => packedType(c, context.owner).deconst) + val (ownType0, needAdapt) = if (isFullyDefined(resTp)) (resTp, false) else weakLub(caseTypes) + val ownType = ownType0.skolemizeExistential(context.owner, context.tree) val casesAdapted = if (!needAdapt) casesTyped else casesTyped map (adaptCase(_, mode, ownType)) // val (owntype0, needAdapt) = ptOrLub(casesTyped map (x => repackExistential(x.tpe))) // val owntype = elimAnonymousClass(owntype0) @@ -3542,7 +3542,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { // in the special (though common) case where the types are equal, it pays to pack before comparing // especially virtpatmat needs more aggressive unification of skolemized types // this breaks src/library/scala/collection/immutable/TrieIterator.scala - if (opt.virtPatmat && !isPastTyper && thenTp =:= elseTp) (thenp1.tpe, true) // use unpacked type + if (opt.virtPatmat && !isPastTyper && thenTp =:= elseTp) (thenp1.tpe, false) // use unpacked type // TODO: skolemize (lub of packed types) when that no longer crashes on files/pos/t4070b.scala else ptOrLub(List(thenp1.tpe, elsep1.tpe)) |