-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #4947: Do not replace positions of inlined arguments #4949
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
24b0d82
Fix #4947: Do not replace positions of inlined arguments
nicolasstucki 3a6b56b
Use enclosingInlineds directly to know the position
21f7aa3
Add docs
10ce2e8
Add bytecode tests and fix position of transitivly inlined trees
nicolasstucki 0ff3fd7
Add more tests
nicolasstucki 2837365
Fix typo
nicolasstucki 857f53e
Add more tests
nicolasstucki a11db37
Retain positions of trees inlined from the same file
nicolasstucki a12688a
Check that all trasnparent methods have been erased
nicolasstucki 53e85d6
Remove useless check
nicolasstucki d52c3b2
Add topLevelClass and do not assume transformation of posttyper
nicolasstucki 27ab7ee
Test recursive transparent method
Blaisorblade f043599
Only reposition trees from other files, not other classes
Blaisorblade e21ae3f
Typo
Blaisorblade cc6ca5f
Use local method
nicolasstucki dc66cce
Improve some docs
Blaisorblade bf1ae93
Complicate tests
Blaisorblade 7850b1e
Test parameters from other files
Blaisorblade 4c51bc3
Use correct API ctx.source
Blaisorblade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -335,4 +335,5 @@ class TestBCode extends DottyBytecodeTest { | |
assert(!fooInvoke, "foo should not be called\n") | ||
} | ||
} | ||
|
||
} |
This file contains hidden or 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 hidden or 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,4 @@ | ||
track: Test$.main(i4947.scala:4) | ||
track: Test$.main(i4947.scala:5) | ||
main1: Test$.main(i4947.scala:15) | ||
main2: Test$.main(i4947.scala:16) |
This file contains hidden or 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,20 @@ | ||
object Test { | ||
|
||
transparent def track[T](f: => T): T = { | ||
printStack("track") | ||
printStack("track") | ||
f | ||
} | ||
|
||
def printStack(tag: String): Unit = { | ||
println(tag + ": "+ new Exception().getStackTrace().apply(1)) | ||
} | ||
|
||
def main(args: Array[String]): Unit = { | ||
track { | ||
printStack("main1") | ||
printStack("main2") | ||
} | ||
} | ||
|
||
} |
This file contains hidden or 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,14 @@ | ||
track (i = 0): Test$.main(i4947a.scala:4) | ||
track (i = 0): Test$.main(i4947a.scala:5) | ||
track (i = 2): Test$.main(i4947a.scala:4) | ||
track (i = 2): Test$.main(i4947a.scala:5) | ||
main1 (i = -1): Test$.main(i4947a.scala:21) | ||
main2 (i = -1): Test$.main(i4947a.scala:22) | ||
track (i = 1): Test$.main(i4947a.scala:4) | ||
track (i = 1): Test$.main(i4947a.scala:5) | ||
main1 (i = -1): Test$.main(i4947a.scala:21) | ||
main2 (i = -1): Test$.main(i4947a.scala:22) | ||
track (i = 0): Test$.main(i4947a.scala:4) | ||
track (i = 0): Test$.main(i4947a.scala:5) | ||
main1 (i = -1): Test$.main(i4947a.scala:21) | ||
main2 (i = -1): Test$.main(i4947a.scala:22) |
This file contains hidden or 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,27 @@ | ||
object Test { | ||
|
||
transparent def fact[T](transparent i: Int)(f: => T): Int = { | ||
printStack("track", i) | ||
printStack("track", i) | ||
f | ||
if (i == 0) | ||
1 | ||
else { | ||
i * fact(i-1)(f) | ||
} | ||
} | ||
|
||
def printStack(tag: String, i: Int): Unit = { | ||
println(s"$tag (i = $i): ${new Exception().getStackTrace().apply(1)}") | ||
} | ||
|
||
def main(args: Array[String]): Unit = { | ||
fact(0) { | ||
fact(2) { | ||
printStack("main1", -1) | ||
printStack("main2", -1) | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These testcases are good and go beyond #4947.