forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit indent at width after colon arrow eol
- Loading branch information
Showing
5 changed files
with
131 additions
and
10 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
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,44 @@ | ||
|
||
def fn2(arg: String, arg2: String)(f: String => Unit): Unit = f(arg) | ||
|
||
def fn3(arg: String, arg2: String)(f: => Unit): Unit = f | ||
|
||
def test1() = | ||
|
||
fn2(arg = "blue sleeps faster than tuesday", arg2 = "the quick brown fox jumped over the lazy dog"): env => | ||
val x = env | ||
println(x) | ||
|
||
fn2( // error not a legal formal parameter for a function literal | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): env => | ||
val x = env // error | ||
println(x) | ||
|
||
fn2( // error | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): env => | ||
val x = env // error | ||
println(x) | ||
|
||
fn2( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): | ||
env => // error indented definitions expected, identifier env found | ||
val x = env | ||
println(x) | ||
|
||
def test2() = | ||
|
||
fn2( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog" | ||
): env => | ||
val x = env | ||
println(x) | ||
|
||
fn3( // error missing argument list for value of type (=> Unit) => Unit | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): | ||
val x = "Hello" // error | ||
println(x) // error |
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,57 @@ | ||
|
||
def fn2(arg: String, arg2: String)(f: String => Unit): Unit = f(arg) | ||
|
||
def fn3(arg: String, arg2: String)(f: => Unit): Unit = f | ||
|
||
def test() = | ||
|
||
fn2(arg = "blue sleeps faster than tuesday", arg2 = "the quick brown fox jumped over the lazy dog"): env => | ||
val x = env | ||
println(x) | ||
|
||
// doesn't compile | ||
fn2( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): env => | ||
val x = env | ||
println(x) | ||
|
||
fn2( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): env => | ||
val x = env | ||
println(x) | ||
|
||
// does compile | ||
fn2( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): | ||
env => | ||
val x = env | ||
println(x) | ||
|
||
// does compile | ||
fn2( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog" | ||
): env => | ||
val x = env | ||
println(x) | ||
|
||
fn3( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): | ||
val x = "Hello" | ||
println(x) | ||
|
||
fn3( | ||
arg = "blue sleeps faster than tuesday", | ||
arg2 = "the quick brown fox jumped over the lazy dog"): | ||
val x = "Hello" | ||
println(x) | ||
|
||
// don't turn innocent empty cases into functions | ||
def regress(x: Int) = | ||
x match | ||
case 42 => | ||
case _ => |