-
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.
Show inlined positions with source code
This gives more context to the users on what happen and where the code came from.
- Loading branch information
1 parent
59a3d9c
commit 9e8c5af
Showing
27 changed files
with
416 additions
and
107 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
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
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 @@ | ||
|
||
-- Error: tests/neg-macros/i13991/Test_2.scala:6:5 --------------------------------------------------------------------- | ||
6 | v2 // error | ||
| ^^ | ||
| Error | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
|Inline stack trace | ||
|····················································································································· | ||
|This location contains code that was inlined from Test_2.scala:3 | ||
3 | inline def v2 = InlineMac.sample("foo") | ||
| ^^^^^ | ||
|····················································································································· | ||
|This location contains code that was inlined from Test_2.scala:3 | ||
3 | inline def v2 = InlineMac.sample("foo") | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
·--------------------------------------------------------------------------------------------------------------------- |
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,10 @@ | ||
import scala.quoted.* | ||
|
||
object InlineMac: | ||
|
||
inline def sample(inline expr: String): Int = | ||
${ sampleImpl('expr) } | ||
|
||
def sampleImpl(expr: Expr[String])(using Quotes): Expr[Int] = | ||
import quotes.reflect.* | ||
report.errorAndAbort("Error", expr) |
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,6 @@ | ||
object Main: | ||
def main(args: Array[String]): Unit = | ||
inline def v2 = InlineMac.sample("foo") | ||
inline def v1 = v2 | ||
|
||
v2 // 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
Oops, something went wrong.