-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14441 from som-snytt/issue/14386
Don't compute indents when in a string
- Loading branch information
Showing
2 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// scalac: -Werror | ||
def logLevelDetail(level: Int): String = | ||
s"""$level | ||
|
||
// the following line is indented using [tab][tab] | ||
Sets the global logging level to $level. | ||
""" | ||
/* was 2 errors with carets as shown | ||
| ^ ^ | ||
| Incompatible combinations of tabs and spaces in indentation prefixes. | ||
| Previous indent : 3 spaces | ||
| Latest indent : 2 tabs | ||
*/ | ||
|
||
def log(level: Int, msg: String): String = | ||
s""" | ||
$level | ||
prefixed $level suffixed | ||
""" | ||
/* | ||
^ ^ | ||
Incompatible combinations of tabs and spaces in indentation prefixes. | ||
Previous indent : 2 tabs | ||
Latest indent : 2 space | ||
*/ | ||
|
||
// normal mixed tabs errors as a baseline | ||
def g = | ||
42 | ||
+ 17 // error | ||
|
||
def p() = | ||
println("hello") | ||
println("world") // error | ||
/* | ||
| Incompatible combinations of tabs and spaces in indentation prefixes. | ||
| Previous indent : 4 spaces | ||
| Latest indent : 1 tab | ||
*/ | ||
|
||
def braced() = | ||
s"""begin | ||
${ | ||
val level = 10 | ||
val msg = "hello, world" // error he lets me off with a warning | ||
log(level, msg) // error | ||
} | ||
end""" |