-
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.
Detect macro dependencies within the current run
- Loading branch information
1 parent
7423d31
commit c030b30
Showing
14 changed files
with
133 additions
and
8 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,8 @@ | ||
-- Error: tests/neg-macros/macros-in-same-project-1/Bar.scala:2:13 ----------------------------------------------------- | ||
2 | Foo.myMacro() // error | ||
| ^^^^^^^^^^^^^ | ||
|Failed to expand macro. This macro depends on an implementation that is defined in the same project and not yet compiled. | ||
|In particular method myMacro depends on method aMacroImplementation. | ||
| | ||
|Moving method aMacroImplementation to a different project would fix this. | ||
| This location is in code that was inlined at Bar.scala:2 |
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,3 @@ | ||
object Bar { | ||
Foo.myMacro() // 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,9 @@ | ||
import scala.quoted._ | ||
|
||
object Foo { | ||
|
||
inline def myMacro(): Unit = ${ aMacroImplementation } | ||
|
||
def aMacroImplementation given QuoteContext: Expr[Unit] = '{ println("Hello") } | ||
|
||
} |
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,8 @@ | ||
-- Error: tests/neg-macros/macros-in-same-project-2/Bar.scala:5:9 ------------------------------------------------------ | ||
5 | myMacro() // error | ||
| ^^^^^^^^^ | ||
|Failed to expand macro. This macro depends on an implementation that is defined in the same project and not yet compiled. | ||
|In particular method myMacro depends on method aMacroImplementation, object Foo. | ||
| | ||
|Moving method aMacroImplementation, object Foo to a different project would fix this. | ||
| This location is in code that was inlined at Bar.scala:5 |
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,7 @@ | ||
object Bar { | ||
|
||
inline def myMacro(): Unit = ${ Foo.aMacroImplementation } | ||
|
||
myMacro() // 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,7 @@ | ||
import scala.quoted._ | ||
|
||
object Foo { | ||
|
||
def aMacroImplementation given QuoteContext: Expr[Unit] = '{ println("Hello") } | ||
|
||
} |
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,8 @@ | ||
-- Error: tests/neg-macros/macros-in-same-project-3/Baz.scala:2:13 ----------------------------------------------------- | ||
2 | Bar.myMacro() // error | ||
| ^^^^^^^^^^^^^ | ||
|Failed to expand macro. This macro depends on an implementation that is defined in the same project and not yet compiled. | ||
|In particular method myMacro depends on method aMacroImplementation. | ||
| | ||
|Moving method aMacroImplementation to a different project would fix this. | ||
| This location is in code that was inlined at Baz.scala:2 |
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,9 @@ | ||
import scala.quoted._ | ||
|
||
object Bar { | ||
|
||
inline def myMacro(): Unit = ${ aMacroImplementation } | ||
|
||
def aMacroImplementation given QuoteContext: Expr[Unit] = Foo.hello() | ||
|
||
} |
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,3 @@ | ||
object Baz { | ||
Bar.myMacro() // 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,7 @@ | ||
import scala.quoted._ | ||
|
||
object Foo { | ||
|
||
def hello() given QuoteContext: Expr[Unit] = '{ println("Hello") } | ||
|
||
} |
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,8 @@ | ||
-- Error: tests/neg-macros/macros-in-same-project-4/Bar.scala:5:13 ----------------------------------------------------- | ||
5 | Foo.myMacro() // error | ||
| ^^^^^^^^^^^^^ | ||
|Failed to expand macro. This macro depends on an implementation that is defined in the same project and not yet compiled. | ||
|In particular method myMacro depends on method aMacroImplementation. | ||
| | ||
|Moving method aMacroImplementation to a different project would fix this. | ||
| This location is in code that was inlined at Bar.scala:5 |
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,8 @@ | ||
import scala.quoted._ | ||
|
||
object Bar { | ||
|
||
Foo.myMacro() // error | ||
|
||
def hello() given QuoteContext: Expr[Unit] = '{ println("Hello") } | ||
} |
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,9 @@ | ||
import scala.quoted._ | ||
|
||
object Foo { | ||
|
||
inline def myMacro(): Unit = ${ aMacroImplementation } | ||
|
||
def aMacroImplementation given QuoteContext: Expr[Unit] = Bar.hello() | ||
|
||
} |