Skip to content

Commit 6f3c806

Browse files
committed
Remove unnecessary abstraction
1 parent 77fe850 commit 6f3c806

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ object PickledQuotes {
3838

3939
/** Transform the expression into its fully spliced Tree */
4040
def quotedExprToTree[T](expr: quoted.Expr[T])(implicit ctx: Context): Tree = {
41-
val expr1 = expr.asInstanceOf[TastyTreeExpr[Tree]]
41+
val expr1 = expr.asInstanceOf[TastyTreeExpr]
4242
QuoteContext.checkScopeId(expr1.scopeId)
4343
healOwner(expr1.tree)
4444
}
4545

4646
/** Transform the expression into its fully spliced TypeTree */
4747
def quotedTypeToTree(tpe: quoted.Type[?])(implicit ctx: Context): Tree = {
48-
val tpe1 = tpe.asInstanceOf[TreeType[Tree]]
48+
val tpe1 = tpe.asInstanceOf[TreeType]
4949
QuoteContext.checkScopeId(tpe1.scopeId)
5050
healOwner(tpe1.typeTree)
5151
}

compiler/src/dotty/tools/dotc/tastyreflect/TastyTreeExpr.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package dotty.tools.dotc.tastyreflect
22

3+
import dotty.tools.dotc.ast.tpd.Tree
4+
35
/** An Expr backed by a tree. Only the current compiler trees are allowed.
46
*
57
* These expressions are used for arguments of macros. They contain and actual tree
68
* from the program that is being expanded by the macro.
79
*
810
* May contain references to code defined outside this TastyTreeExpr instance.
911
*/
10-
final class TastyTreeExpr[Tree](val tree: Tree, val scopeId: Int) extends scala.quoted.Expr[Any] {
12+
final class TastyTreeExpr(val tree: Tree, val scopeId: Int) extends scala.quoted.Expr[Any] {
1113
override def equals(that: Any): Boolean = that match {
12-
case that: TastyTreeExpr[_] =>
14+
case that: TastyTreeExpr =>
1315
// TastyTreeExpr are wrappers around trees, therfore they are equals if their trees are equal.
1416
// All scopeId should be equal unless two different runs of the compiler created the trees.
1517
tree == that.tree && scopeId == that.scopeId

compiler/src/dotty/tools/dotc/tastyreflect/TreeType.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package dotty.tools.dotc.tastyreflect
22

3+
import dotty.tools.dotc.ast.tpd.Tree
4+
35
/** An Type backed by a tree */
4-
final class TreeType[Tree](val typeTree: Tree, val scopeId: Int) extends scala.quoted.Type[Any] {
6+
final class TreeType(val typeTree: Tree, val scopeId: Int) extends scala.quoted.Type[Any] {
57
override def equals(that: Any): Boolean = that match {
6-
case that: TreeType[_] => typeTree ==
8+
case that: TreeType => typeTree ==
79
// TastyTreeExpr are wrappers around trees, therfore they are equals if their trees are equal.
810
// All scopeId should be equal unless two different runs of the compiler created the trees.
911
that.typeTree && scopeId == that.scopeId

0 commit comments

Comments
 (0)