scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Missing indentation warning

Open nicolasstucki opened this issue 5 years ago • 3 comments

Code

The following compiles without warnings.

class Foo:
  def sum(xs: List[Int]): Int = loop(0, xs)
    def loop(sum: Int, xs: List[Int]): Int =
      xs match
        case head :: tail => loop(sum + head, tail)
        case Nil => sum

Output

Foo will have both public methods sum and loop, but the syntax seems to suggest that loop is local.

Expectation

Should warn about misaligned indentation.

nicolasstucki avatar Oct 19 '20 07:10 nicolasstucki