Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Incompatible combinations of tabs and spaces in indentation prefixes." significant indentation is enforced in a literal #14386

Closed
eed3si9n opened this issue Jan 30, 2022 · 1 comment · Fixed by #14441
Labels
area:parser itype:bug Spree Suitable for a future Spree
Milestone

Comments

@eed3si9n
Copy link
Member

eed3si9n commented Jan 30, 2022

Compiler version

3.1.1

Minimized code

package example

def logLevelDetail(level: Int): String =
  s"""$level

// the following line is indented using [tab][tab]
		Sets the global logging level to $level.
"""

Output

sbt:hello> compile
[info] compiling 1 Scala source to /private/tmp/hello/target/scala-3.1.1/classes ...
[error] -- Error: /private/tmp/hello/src/main/scala/example/Hello.scala:7:34 -----------
[error] 7 |		Sets the global logging level to $level.
[error]   |		                                  ^
[error]   |     Incompatible combinations of tabs and spaces in indentation prefixes.
[error]   |     Previous indent : 2 spaces
[error]   |     Latest indent   : 2 tabs
[error] -- Error: /private/tmp/hello/src/main/scala/example/Hello.scala:7:39 -----------
[error] 7 |		Sets the global logging level to $level.
[error]   |		                                       ^
[error]   |     Incompatible combinations of tabs and spaces in indentation prefixes.
[error]   |     Previous indent : 2 spaces
[error]   |     Latest indent   : 2 tabs
[error] two errors found
[error] two errors found

Expectation

It compiles. Indentation rules should not apply to lines within multiline string literals.

@eed3si9n eed3si9n added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jan 30, 2022
@som-snytt
Copy link
Contributor

s"""I wonder about interpolated block expressions ${
  def f = level + 1
  f
} of the sort championed by Li Haoyi."""

@smarter smarter added area:parser Spree Suitable for a future Spree and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jan 31, 2022
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:parser itype:bug Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants