File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,10 @@ class ReifyQuotes extends MacroTransformWithImplicits {
172
172
// Maps type splices to type references of tags e.g., ~t -> some type T$1
173
173
val map : Map [Type , Type ] = tagsExplicitTypeDefsPairs.map(x => (x._1, x._2.symbol.typeRef)).toMap
174
174
val tMap = new TypeMap () {
175
- override def apply (tp : Type ): Type = {
176
- if (map.contains(tp))
177
- map.apply(tp)
178
- else
179
- mapOver(tp)
180
- }
175
+ override def apply (tp : Type ): Type = map.getOrElse(tp, mapOver(tp))
181
176
}
182
177
183
- Block (typeDefs ++ tagsExplicitTypeDefsPairs.map(_._2) ,
178
+ Block (typeDefs ++ explicitTypeDefs ,
184
179
new TreeTypeMap (
185
180
typeMap = tMap,
186
181
substFrom = itags.map(_._1.symbol),
@@ -463,8 +458,6 @@ class ReifyQuotes extends MacroTransformWithImplicits {
463
458
case tree : TypeTree if tree.tpe.typeSymbol.isSplice =>
464
459
val splicedType = tree.tpe.asInstanceOf [TypeRef ].prefix.termSymbol
465
460
splice(ref(splicedType).select(tpnme.UNARY_~ ))
466
- case tree : TypeApply =>
467
- super .transform(tree)
468
461
case tree : Select if tree.symbol.isSplice =>
469
462
splice(tree)
470
463
case tree : RefTree if needsLifting(tree) =>
Original file line number Diff line number Diff line change @@ -118,11 +118,9 @@ package liftable {
118
118
}
119
119
120
120
object Arrays {
121
- // FIXME missing hole for ~t
122
- // implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], ct: Expr[ClassTag[T]]): Liftable[Array[T]] = (arr: Array[T]) => '{
123
- // new Array[~t](~(arr.length: Expr[Int]))(~ct)
124
- // }
125
-
121
+ implicit def ArrayIsLiftable [T : Liftable ](implicit t : Type [T ], ct : Expr [ClassTag [T ]]): Liftable [Array [T ]] = (arr : Array [T ]) => ' {
122
+ new Array [~ t](~ (arr.length: Expr [Int ]))(~ ct)
123
+ }
126
124
}
127
125
128
126
}
You can’t perform that action at this time.
0 commit comments