File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -763,6 +763,16 @@ trait Applications extends Compatibility { self: Typer =>
763
763
}
764
764
}
765
765
766
+ /** A dummmy typed unapply, to make re-typers between frontend and pattern matcher
767
+ * visit all subnodes of an unApply tree.
768
+ */
769
+ def typedUnApply (tree : untpd.UnApply , selType : Type )(implicit ctx : Context ) = {
770
+ val unappType = typed(tree.fun)
771
+ tree.implicits.foreach(typed(_))
772
+ tree.patterns.foreach(typedPattern(_))
773
+ tree.withType(selType)
774
+ }
775
+
766
776
/** Is given method reference applicable to type arguments `targs` and argument trees `args`?
767
777
* @param resultType The expected result type of the application
768
778
*/
Original file line number Diff line number Diff line change @@ -1017,6 +1017,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1017
1017
case tree : untpd.PackageDef => typedPackageDef(tree)
1018
1018
case tree : untpd.Annotated => typedAnnotated(tree, pt)
1019
1019
case tree : untpd.TypedSplice => tree.tree
1020
+ case tree : untpd.UnApply => typedUnApply(tree, pt)
1020
1021
case untpd.PostfixOp (tree, nme.WILDCARD ) => typedAsFunction(tree, pt)
1021
1022
case untpd.EmptyTree => tpd.EmptyTree
1022
1023
case _ => typedUnadapted(desugar(tree), pt)
You can’t perform that action at this time.
0 commit comments