-
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.
- Loading branch information
1 parent
acc8ef6
commit 5146353
Showing
5 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Cyclic macro dependencies in tests/neg-macros/i19526/Test.scala. | ||
Compilation stopped since no further progress can be made. | ||
|
||
To fix this, place macros in one set of files and their callers in another. | ||
|
||
Compile with -Xprint-suspension for information. |
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,15 @@ | ||
package crash.test | ||
|
||
import scala.language.dynamics | ||
|
||
import scala.quoted.* | ||
|
||
object Export extends Dynamic: | ||
inline def applyDynamic(name: "apply")(inline args: Any*): Stack = ${ | ||
applyDynamicImpl('args) | ||
} | ||
|
||
def applyDynamicImpl(args: Expr[Seq[Any]])(using Quotes): Expr[Stack] = | ||
import quotes.reflect.* | ||
|
||
'{ Stack("", Vector.empty) } |
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,14 @@ | ||
package crash.test | ||
|
||
case class Stack private[crash] ( | ||
exports: String, | ||
dependsOn: Vector[Int] | ||
) | ||
|
||
trait StackFactory: | ||
val exports: Export.type = Export | ||
|
||
def apply(dependsOn: Int*): Stack = | ||
Export().copy(dependsOn = dependsOn.toVector) | ||
|
||
// nopos-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,15 @@ | ||
package crash.test | ||
|
||
import scala.language.dynamics | ||
|
||
import scala.quoted.* | ||
|
||
object Export extends Dynamic: | ||
inline def applyDynamic(name: "apply")(inline args: Any*): Stack = ${ | ||
applyDynamicImpl('args) | ||
} | ||
|
||
def applyDynamicImpl(args: Expr[Seq[Any]])(using Quotes): Expr[Stack] = | ||
import quotes.reflect.* | ||
|
||
'{ Stack("", Vector.empty) } |
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 @@ | ||
package crash.test | ||
|
||
case class Stack private[crash] ( | ||
exports: String, | ||
dependsOn: Vector[Int] | ||
) | ||
|
||
object Stack: | ||
@annotation.publicInBinary | ||
private[crash] def apply(exports: String, dependsOn: Vector[Int]): Stack = new Stack(exports, dependsOn) | ||
|
||
trait StackFactory: | ||
val exports: Export.type = Export | ||
|
||
def apply(dependsOn: Int*): Stack = | ||
Export().copy(dependsOn = dependsOn.toVector) |