Skip to content

Commit

Permalink
Use class.cast
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed Aug 20, 2023
1 parent 37f8aaa commit b5e1b76
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,8 @@ private[surface] class CompileTimeSurfaceFactory[Q <: Quotes](using quotes: Q) {

private def clsCast(term: Term, t: TypeRepr): Term = {
if(clsOfToVar.contains(t)) {
// TODO Use Class.cast
// __cl0.cast(term)
Select.unique(Ref(clsOfToVar(t)), "cast").appliedToArgs(List(term))
//Select.unique(term, "asInstanceOf").appliedToType(t)
}
else {
Select.unique(term, "asInstanceOf").appliedToType(t)
Expand Down

0 comments on commit b5e1b76

Please sign in to comment.