We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
if
1 parent ec82b80 commit d8ff1cdCopy full SHA for d8ff1cd
1 file changed
tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/SignificantIndentationSuite.scala
@@ -2072,6 +2072,20 @@ class SignificantIndentationSuite extends BaseDottySuite {
2072
))
2073
}
2074
2075
+ test("`if` body is a partial function") {
2076
+ val code =
2077
+ """| if foo then
2078
+ | case msg1: Int => msg1 + 1
2079
+ | else
2080
+ | case msg2: Int => msg2 + 2
2081
+ |""".stripMargin
2082
+ val error =
2083
+ """|<input>:2: error: `outdent` expected but `case` found
2084
2085
+ | ^""".stripMargin
2086
+ runTestError[Stat](code, error)
2087
+ }
2088
+
2089
test("def body is non-partial function") {
2090
val code =
2091
"""|object a:
0 commit comments