-
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.
Fix unused lifted args before unused checks
Also fix position of lifted arg reference tree.
- Loading branch information
1 parent
faea603
commit 975b36f
Showing
3 changed files
with
31 additions
and
2 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,16 @@ | ||
object Test { | ||
def foo(a: Int)(b: Int, c: Int) = 42 | ||
unused def bar(i: Int): Int = { | ||
println(1) | ||
42 | ||
} | ||
def baz: Int = { | ||
println(1) | ||
2 | ||
} | ||
foo( | ||
bar(baz) // error | ||
)( | ||
c = baz, b = baz // force all args to be lifted in vals befor the call | ||
) | ||
} |
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,12 @@ | ||
object Test { | ||
def foo(unused a: Int)(b: Int, c: Int) = 42 | ||
unused def bar(i: Int): Int = { | ||
println(1) | ||
42 | ||
} | ||
def baz: Int = { | ||
println(1) | ||
2 | ||
} | ||
foo(bar(baz))(c = baz, b = baz) // force all args to be lifted in vals befor the call | ||
} |