aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-14 19:13:03 +0100
committerMartin Odersky <odersky@gmail.com>2014-12-15 16:36:53 +0100
commit0eec180a686a4425bd3f3089006eda530123fe2e (patch)
tree9472beb8aba974cc95444e4351565d323913efeb /src/dotty/tools/dotc/typer/Applications.scala
parent21fa5dd1a47727c977848163e2610be745951dbc (diff)
downloaddotty-0eec180a686a4425bd3f3089006eda530123fe2e.tar.gz
dotty-0eec180a686a4425bd3f3089006eda530123fe2e.tar.bz2
dotty-0eec180a686a4425bd3f3089006eda530123fe2e.zip
Add a typedUnApply method.
The method is needed to be able to survive ReTypers between frontend and pattern matching.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index fe45beb04..d54ff21be 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -763,6 +763,16 @@ trait Applications extends Compatibility { self: Typer =>
}
}
+ /** A dummmy typed unapply, to make re-typers between frontend and pattern matcher
+ * visit all subnodes of an unApply tree.
+ */
+ def typedUnApply(tree: untpd.UnApply, selType: Type)(implicit ctx: Context) = {
+ val unappType = typed(tree.fun)
+ tree.implicits.foreach(typed(_))
+ tree.patterns.foreach(typedPattern(_))
+ tree.withType(selType)
+ }
+
/** Is given method reference applicable to type arguments `targs` and argument trees `args`?
* @param resultType The expected result type of the application
*/