File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ class ReTyper extends Typer {
5858 }
5959
6060 override def typedUnApply (tree : untpd.UnApply , selType : Type )(implicit ctx : Context ): UnApply = {
61- val fun1 = typedExpr(tree.fun, AnyFunctionProto )
61+ val funProto = new UnapplyFunProto (WildcardType , this )
62+
63+ val fun1 = typedExpr(tree.fun, funProto)
6264 val implicits1 = tree.implicits.map(typedExpr(_))
6365 val patterns1 = tree.patterns.mapconserve(pat => typed(pat, pat.tpe))
6466 untpd.cpy.UnApply (tree)(fun1, implicits1, patterns1).withType(tree.tpe)
Original file line number Diff line number Diff line change @@ -2125,7 +2125,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
21252125 tree match {
21262126 case _ : RefTree | _ : Literal
21272127 if ! isVarPattern(tree) &&
2128- ! (tree.tpe <:< pt)(ctx.addMode(Mode .GADTflexible )) =>
2128+ ! (tree.tpe <:< pt)(ctx.addMode(Mode .GADTflexible )) &&
2129+ ! this .isInstanceOf [ReTyper ] =>
21292130 val cmp =
21302131 untpd.Apply (
21312132 untpd.Select (untpd.TypedSplice (tree), nme.EQ ),
Original file line number Diff line number Diff line change 1+ object Test {
2+ inline def openImpl (): Int =
3+ Some (42 ) match { case Some (i) => i }
4+
5+ def open (): Int = openImpl()
6+
7+ inline def openImpl2 (): Int =
8+ Some (42 ) match { case None => 42 }
9+
10+ def open2 (): Int = openImpl2()
11+ }
You can’t perform that action at this time.
0 commit comments