File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -38,14 +38,14 @@ object PickledQuotes {
38
38
39
39
/** Transform the expression into its fully spliced Tree */
40
40
def quotedExprToTree [T ](expr : quoted.Expr [T ])(implicit ctx : Context ): Tree = {
41
- val expr1 = expr.asInstanceOf [TastyTreeExpr [ Tree ] ]
41
+ val expr1 = expr.asInstanceOf [TastyTreeExpr ]
42
42
QuoteContext .checkScopeId(expr1.scopeId)
43
43
healOwner(expr1.tree)
44
44
}
45
45
46
46
/** Transform the expression into its fully spliced TypeTree */
47
47
def quotedTypeToTree (tpe : quoted.Type [? ])(implicit ctx : Context ): Tree = {
48
- val tpe1 = tpe.asInstanceOf [TreeType [ Tree ] ]
48
+ val tpe1 = tpe.asInstanceOf [TreeType ]
49
49
QuoteContext .checkScopeId(tpe1.scopeId)
50
50
healOwner(tpe1.typeTree)
51
51
}
Original file line number Diff line number Diff line change 1
1
package dotty .tools .dotc .tastyreflect
2
2
3
+ import dotty .tools .dotc .ast .tpd .Tree
4
+
3
5
/** An Expr backed by a tree. Only the current compiler trees are allowed.
4
6
*
5
7
* These expressions are used for arguments of macros. They contain and actual tree
6
8
* from the program that is being expanded by the macro.
7
9
*
8
10
* May contain references to code defined outside this TastyTreeExpr instance.
9
11
*/
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 ] {
11
13
override def equals (that : Any ): Boolean = that match {
12
- case that : TastyTreeExpr [_] =>
14
+ case that : TastyTreeExpr =>
13
15
// TastyTreeExpr are wrappers around trees, therfore they are equals if their trees are equal.
14
16
// All scopeId should be equal unless two different runs of the compiler created the trees.
15
17
tree == that.tree && scopeId == that.scopeId
Original file line number Diff line number Diff line change 1
1
package dotty .tools .dotc .tastyreflect
2
2
3
+ import dotty .tools .dotc .ast .tpd .Tree
4
+
3
5
/** 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 ] {
5
7
override def equals (that : Any ): Boolean = that match {
6
- case that : TreeType [_] => typeTree ==
8
+ case that : TreeType => typeTree ==
7
9
// TastyTreeExpr are wrappers around trees, therfore they are equals if their trees are equal.
8
10
// All scopeId should be equal unless two different runs of the compiler created the trees.
9
11
that.typeTree && scopeId == that.scopeId
You can’t perform that action at this time.
0 commit comments