-
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.
Do not expose ClassInfo in widenTermRefByName
Previously ClassInfo could be easily be exposed with calls like `TypeRepr.of[T].termRef.widenTermRefByName`. [Cherry-picked 5009065]
- Loading branch information
1 parent
27bb69a
commit 680b045
Showing
3 changed files
with
17 additions
and
1 deletion.
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,12 @@ | ||
import scala.quoted._ | ||
|
||
inline def matchCustom[F](): Unit = ${ matchCustomImpl[F] } | ||
|
||
private def matchCustomImpl[F: Type](using q: Quotes): Expr[Unit] = { | ||
import q.reflect.* | ||
val any = TypeRepr.of[Any].typeSymbol | ||
assert(!any.termRef.widenTermRefByName.toString.contains("ClassInfo")) | ||
any.termRef.widenTermRefByName.asType match | ||
case '[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 @@ | ||
def main() = matchCustom() |