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 {
58
58
}
59
59
60
60
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)
62
64
val implicits1 = tree.implicits.map(typedExpr(_))
63
65
val patterns1 = tree.patterns.mapconserve(pat => typed(pat, pat.tpe))
64
66
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
2125
2125
tree match {
2126
2126
case _ : RefTree | _ : Literal
2127
2127
if ! isVarPattern(tree) &&
2128
- ! (tree.tpe <:< pt)(ctx.addMode(Mode .GADTflexible )) =>
2128
+ ! (tree.tpe <:< pt)(ctx.addMode(Mode .GADTflexible )) &&
2129
+ ! this .isInstanceOf [ReTyper ] =>
2129
2130
val cmp =
2130
2131
untpd.Apply (
2131
2132
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