Skip to content

a space on the last line of the file causes a compilation error #22332

Closed
@OlgaDor

Description

@OlgaDor

Compiler version

Scala compiler version 3.3.3 or later

Minimized code

object Foo:
  val foo = 1
 // one space on the last line of the file causes a compilation error

Output

[error] 3 | // one space on the last line of the file causes a compilation error
[error]   |                                                                     ^
[error]   |The start of this line does not match any of the previous indentation widths.
[error]   |Indentation width of current line : 1 space
[error]   |This falls between previous widths: 0 spaces and 2 spaces
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

The compilation error results in red code in IntelliJ IDEA

Expectation

The code should compile without errors

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions