File tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1465,8 +1465,8 @@ class Typer extends Namer
1465
1465
case _ =>
1466
1466
if tree.isInline then checkInInlineContext(" inline match" , tree.srcPos)
1467
1467
val sel1 = typedExpr(tree.selector)
1468
- val selType = fullyDefinedType(sel1.tpe, " pattern selector" , tree.span).widen
1469
-
1468
+ val rawSelectorTpe = fullyDefinedType(sel1.tpe, " pattern selector" , tree.span)
1469
+ val selType = if (tree.isInline) rawSelectorTpe else rawSelectorTpe.widen
1470
1470
/** Extractor for match types hidden behind an AppliedType/MatchAlias */
1471
1471
object MatchTypeInDisguise {
1472
1472
def unapply (tp : AppliedType ): Option [MatchType ] = tp match {
Original file line number Diff line number Diff line change
1
+ transparent inline def f : String =
2
+ inline 10 match
3
+ case _ =>
4
+ inline " foo" match
5
+ case x : String => x
6
+
7
+ def test =
8
+ inline val failMsg = f
You can’t perform that action at this time.
0 commit comments