-
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.
Fix StaleSymbol for path dependent argument type in macro context
To fix we recalculate the symbol from directly from NamedType when from invalid run, instead of updating it's validity (which is impossible, as its owners do not include it in their decls).
- Loading branch information
Showing
3 changed files
with
17 additions
and
6 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,6 @@ | ||
import scala.quoted.* | ||
|
||
class Bar[T] | ||
object Bar: | ||
transparent inline def bar[T](a: Foo, b: a.Out): Bar[T] = ${ getBarMacro[T] } | ||
def getBarMacro[T](using Quotes, Type[T]): Expr[Bar[T]] = '{ new Bar[T] } |
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 Foo: | ||
type Out = Int | ||
val a = Bar.bar(new Foo(), 0) |