File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -54,19 +54,15 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
54
54
* - If inside of a macro definition, check the validity of the macro.
55
55
*/
56
56
protected def transformSplice (body : Tree , splice : Tree )(implicit ctx : Context ): Tree = {
57
- if (level < 0 ) {
58
- ctx.error(s " Splice at level $level is not allowed " , splice.sourcePos)
59
- splice
60
- } else {
61
- val body1 = transform(body)(spliceContext)
62
- splice match {
63
- case Apply (fun : TypeApply , _) if splice.isTerm =>
64
- // Type of the splice itsel must also be healed
65
- // internal.Quoted.expr[F[T]](... T ...) --> internal.Quoted.expr[F[$t]](... T ...)
66
- val tp = checkType(splice.sourcePos).apply(splice.tpe.widenTermRefExpr)
67
- cpy.Apply (splice)(cpy.TypeApply (fun)(fun.fun, tpd.TypeTree (tp) :: Nil ), body1 :: Nil )
68
- case splice : Select => cpy.Select (splice)(body1, splice.name)
69
- }
57
+ assert(level >= 0 )
58
+ val body1 = transform(body)(spliceContext)
59
+ splice match {
60
+ case Apply (fun : TypeApply , _) if splice.isTerm =>
61
+ // Type of the splice itsel must also be healed
62
+ // internal.Quoted.expr[F[T]](... T ...) --> internal.Quoted.expr[F[$t]](... T ...)
63
+ val tp = checkType(splice.sourcePos).apply(splice.tpe.widenTermRefExpr)
64
+ cpy.Apply (splice)(cpy.TypeApply (fun)(fun.fun, tpd.TypeTree (tp) :: Nil ), body1 :: Nil )
65
+ case splice : Select => cpy.Select (splice)(body1, splice.name)
70
66
}
71
67
}
72
68
You can’t perform that action at this time.
0 commit comments