Skip to content

Commit 354e03c

Browse files
Merge pull request #6790 from dotty-staging/quote-artefact-cleanup-2
Cleanup unnecessary blocks created for type tags in pickled quotes
2 parents a991cac + 5f72cc3 commit 354e03c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ object PickledQuotes {
3838
/** Force unpickling of the tree, removes the spliced type `@quotedTypeTag type` definitions and dealiases references to `@quotedTypeTag type` */
3939
val forceAndCleanArtefacts = new TreeMap {
4040
override def transform(tree: tpd.Tree)(implicit ctx: Context): tpd.Tree = tree match {
41-
case tree: TypeDef if tree.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot) => Thicket()
41+
case Block(stat :: rest, expr1) if stat.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot) =>
42+
assert(rest.forall { case tdef: TypeDef => tdef.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot) })
43+
transform(expr1)
4244
case tree => super.transform(tree).withType(dealiasTypeTags(tree.tpe))
4345
}
4446
}

0 commit comments

Comments
 (0)