-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This ensures that `inko fmt` doesn't remove the explicit type annotation and `mut` modifier when formatting binding patterns. This fixes #762. Changelog: fixed
- Loading branch information
1 parent
5c0239e
commit f94e4d1
Showing
3 changed files
with
82 additions
and
1 deletion.
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,29 @@ | ||
fn example1 { | ||
match (10, 20) { | ||
case (a: Int, b: Int) -> {} | ||
} | ||
} | ||
|
||
fn example2 { | ||
match 42 { | ||
case mut a -> {} | ||
} | ||
} | ||
|
||
fn example3 { | ||
match 42 { | ||
case mut loooooooooooooooooooooooooong_naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaameeeeeeeeee -> {} | ||
} | ||
} | ||
|
||
fn example4 { | ||
match 42 { | ||
case mut loooooooooooooooooooooooooong_naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaameeeeeeeeee: TypeNameHere -> {} | ||
} | ||
} | ||
|
||
fn example5 { | ||
match 42 { | ||
case mut loooooooooooooooooooooooooong_naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaameeeeeeeeee: TypeNameHere if true -> {} | ||
} | ||
} |
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,36 @@ | ||
fn example1 { | ||
match (10, 20) { | ||
case (a: Int, b: Int) -> {} | ||
} | ||
} | ||
|
||
fn example2 { | ||
match 42 { | ||
case mut a -> {} | ||
} | ||
} | ||
|
||
fn example3 { | ||
match 42 { | ||
case | ||
mut loooooooooooooooooooooooooong_naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaameeeeeeeeee | ||
-> {} | ||
} | ||
} | ||
|
||
fn example4 { | ||
match 42 { | ||
case | ||
mut loooooooooooooooooooooooooong_naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaameeeeeeeeee: TypeNameHere | ||
-> {} | ||
} | ||
} | ||
|
||
fn example5 { | ||
match 42 { | ||
case | ||
mut loooooooooooooooooooooooooong_naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaameeeeeeeeee: TypeNameHere | ||
if true | ||
-> {} | ||
} | ||
} |