File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1430,7 +1430,8 @@ trait Applications extends Compatibility {
1430
1430
report.error(em " Structural unapply is not supported " , unapplyFn.srcPos)
1431
1431
(unapplyFn, unapplyAppCall)
1432
1432
case Apply (fn, `dummyArg` :: Nil ) =>
1433
- val inlinedUnapplyFn = Inlines .inlinedUnapplyFun(fn)
1433
+ val inlinedUnapplyFn = withoutMode(Mode .Pattern ):
1434
+ Inlines .inlinedUnapplyFun(fn)
1434
1435
(inlinedUnapplyFn, inlinedUnapplyFn.appliedToArgs(`dummyArg` :: Nil ))
1435
1436
case Apply (fn, args) =>
1436
1437
val (fn1, app) = rec(fn)
Original file line number Diff line number Diff line change
1
+ object foo :
2
+ transparent inline def unapply [F ](e : F ): Option [F ] = Some (e.asInstanceOf [F ])
3
+
4
+ class A :
5
+ def test (x : Int ) = x match
6
+ case foo(e) => e
You can’t perform that action at this time.
0 commit comments