Skip to content

Instantly share code, notes, and snippets.

@lyricallogical
Created February 1, 2012 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyricallogical/1715208 to your computer and use it in GitHub Desktop.
Save lyricallogical/1715208 to your computer and use it in GitHub Desktop.
virtpatmat diff for type error
diff --git a/src/compiler/scala/tools/nsc/typechecker/PatMatVirtualiser.scala b/src/compiler/scala/tools/nsc/typechecker/PatMatVirtualiser.sc
ala
index 4457940..8642727 100644
--- a/src/compiler/scala/tools/nsc/typechecker/PatMatVirtualiser.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/PatMatVirtualiser.scala
@@ -648,7 +648,7 @@ defined class Foo */
trait TreeMakers {
def inMatchMonad(tp: Type): Type = appliedType(matchingMonadType, List(tp))
- lazy val optimizingCodeGen = matchingMonadType.typeSymbol eq OptionClass
+ lazy val optimizingCodeGen = false // matchingMonadType.typeSymbol eq OptionClass
abstract class TreeMaker {
def substitution: Substitution =
@@ -1199,7 +1199,7 @@ defined class Foo */
else casesUnOpt
val combinedCases =
- cases.map(combineExtractors(_, pt)).reduceLeft(pmgen.typedOrElse(optPt))
+ cases.map(combineExtractors(_, pt)).reduceLeft(pmgen.typedOrElse(pt)) // optPt))
toHoist = (for (treeMakers <- cases; tm <- treeMakers; hoisted <- tm.treesToHoist) yield hoisted).toList
@@ -1321,8 +1321,9 @@ defined class Foo */
trait MatchCodeGen extends TreeMakers {
lazy val pmgen: CommonCodeGen with MatchingStrategyGen with MonadInstGen =
- if (optimizingCodeGen) (new CommonCodeGen with OptimizedCodeGen {})
- else (new CommonCodeGen with MatchingStrategyGen with MonadInstGen {})
+ // if (optimizingCodeGen) (new CommonCodeGen with OptimizedCodeGen {})
+ // else (new CommonCodeGen with MatchingStrategyGen with MonadInstGen {})
+ (new CommonCodeGen with MatchingStrategyGen with MonadInstGen {})
import CODE._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment