aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/Compiler.scala2
-rw-r--r--src/dotty/tools/dotc/transform/PatternMatcher.scala27
2 files changed, 28 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala
index 709f4b2db..6fd69beb8 100644
--- a/src/dotty/tools/dotc/Compiler.scala
+++ b/src/dotty/tools/dotc/Compiler.scala
@@ -20,7 +20,7 @@ class Compiler {
def phases: List[List[Phase]] =
List(
List(new FrontEnd),
- List(new LazyValsCreateCompanionObjects), //force separataion between lazyVals and LVCreateCO
+ List(new LazyValsCreateCompanionObjects, new PatternMatcher), //force separataion between lazyVals and LVCreateCO
List(new LazyValTranformContext().transformer, new TypeTestsCasts),
List(new Erasure),
List(new UncurryTreeTransform)
diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala
new file mode 100644
index 000000000..ff25a94de
--- /dev/null
+++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -0,0 +1,27 @@
+package dotty.tools.dotc
+package transform
+
+import TreeTransforms._
+import core.DenotTransformers._
+import core.Denotations._
+import core.SymDenotations._
+import core.Contexts._
+import core.Symbols._
+import core.Types._
+import core.Constants._
+import core.StdNames._
+import core.transform.Erasure.isUnboundedGeneric
+import typer.ErrorReporting._
+import ast.Trees._
+
+/** This transform eliminates patterns. Right now it's a dummy.
+ * Awaiting the real pattern matcher.
+ */
+class PatternMatcher extends TreeTransform {
+ import ast.tpd._
+
+ override def name: String = "patternMatcher"
+
+ override def transformCaseDef(tree: CaseDef)(implicit ctx: Context, info: TransformerInfo): Tree =
+ cpy.CaseDef(tree, Literal(Constant("<eliminated pattern>")), tree.guard, tree.body)
+} \ No newline at end of file