Skip to content

Commit

Permalink
Remove code dealing with @SplicedType
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed May 5, 2023
1 parent c084187 commit ab3ac74
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
4 changes: 1 addition & 3 deletions compiler/src/dotty/tools/dotc/staging/HealType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {

private def healTypeRef(tp: TypeRef): Type =
tp.prefix match
case NoPrefix if tp.typeSymbol.hasAnnotation(defn.QuotedRuntime_SplicedTypeAnnot) =>
tp
case prefix: TermRef if tp.symbol.isTypeSplice =>
checkNotWildcardSplice(tp)
if level == 0 then tp else getTagRef(prefix)
Expand All @@ -58,7 +56,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {

private object NonSpliceAlias:
def unapply(tp: TypeRef)(using Context): Option[Type] = tp.underlying match
case TypeAlias(alias) if !tp.symbol.isTypeSplice && !tp.typeSymbol.hasAnnotation(defn.QuotedRuntime_SplicedTypeAnnot) => Some(alias)
case TypeAlias(alias) if !tp.symbol.isTypeSplice => Some(alias)
case _ => None

private def checkNotWildcardSplice(splice: TypeRef): Unit =
Expand Down
3 changes: 0 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ class PickleQuotes extends MacroTransform {
assert(Inlines.inInlineMethod)
case tree: Splice =>
assert(Inlines.inInlineMethod)
case _ : TypeDef if !Inlines.inInlineMethod =>
assert(!tree.symbol.hasAnnotation(defn.QuotedRuntime_SplicedTypeAnnot),
s"${tree.symbol} should have been removed by PickledQuotes because it has a @quoteTypeTag")
case _ =>

override def run(using Context): Unit =
Expand Down
12 changes: 0 additions & 12 deletions compiler/src/dotty/tools/dotc/transform/Splicing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,6 @@ class Splicing extends MacroTransform:
val newSplicedCode1 = splicer.transformSplice(tree.expr, tree.tpe, holeIdx)(using spliceContext)
val newSplicedCode2 = Level0QuoteTransformer.transform(newSplicedCode1)(using spliceContext)
newSplicedCode2
case tree: TypeDef if tree.symbol.hasAnnotation(defn.QuotedRuntime_SplicedTypeAnnot) =>
val tp @ TypeRef(qual: TermRef, _) = tree.rhs.tpe.hiBound: @unchecked
quotedDefs += tree.symbol
val hole = typeHoles.get(qual) match
case Some (hole) => cpy.Hole(hole)(content = EmptyTree)
case None =>
val holeIdx = numHoles
numHoles += 1
val hole = tpd.Hole(false, holeIdx, Nil, ref(qual), TypeTree(tp))
typeHoles.put(qual, hole)
hole
cpy.TypeDef(tree)(rhs = hole)
case _: Template =>
for sym <- tree.symbol.owner.info.decls do
quotedDefs += sym
Expand Down

0 comments on commit ab3ac74

Please sign in to comment.