Skip to content

Commit

Permalink
Use Object.toString for quoted.{Expr, Type} (#16663)
Browse files Browse the repository at this point in the history
Alternative to #16556.

The default to string implementation gives more information on the
expression or type than `'{...}` or `Type.of[..]`. With this string
representation, we will know the class and instance hash.
  • Loading branch information
nicolasstucki authored Jan 23, 2023
2 parents 3800c91 + 80c1556 commit ea93524
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions compiler/src/scala/quoted/runtime/impl/ExprImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ final class ExprImpl(val tree: tpd.Tree, val scope: Scope) extends Expr[Any] {
}

override def hashCode(): Int = tree.hashCode()

override def toString: String = "'{ ... }"
}
2 changes: 0 additions & 2 deletions compiler/src/scala/quoted/runtime/impl/TypeImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ final class TypeImpl(val typeTree: tpd.Tree, val scope: Scope) extends Type[?] {
}

override def hashCode(): Int = typeTree.hashCode()

override def toString: String = "Type.of[...]"
}

0 comments on commit ea93524

Please sign in to comment.