forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore type parameters in macro runtime dependencies
The `macroDependencies` method collects all the definitions that are required to interpret the contents of the splice (using JVM-reflection). We do not care about type parameters because those are erased and the interpreter emulates erased semantics. Fixes scala#12498
- Loading branch information
1 parent
f92ab11
commit 306f55b
Showing
3 changed files
with
12 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
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.* | ||
|
||
class Wrapper[T](t: T): | ||
inline def showType: String = ${ Wrapper.showTypeImpl[T]} | ||
|
||
object Wrapper: | ||
def showTypeImpl[U](using Quotes): Expr[String] = Expr("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,3 @@ | ||
class Person | ||
|
||
def test = Wrapper(new Person).showType |