Skip to content

Commit 424a76a

Browse files
committed
Remove tpt.original for Typed tree, as a workaround of #114
1 parent 84cd530 commit 424a76a

File tree

2 files changed

+234
-212
lines changed
  • compilerplugins-BangNotation/src/main/scala/com/thoughtworks/dsl/compilerplugins
  • keywords-Each/src/test/scala/com/thoughtworks/dsl/keywords

2 files changed

+234
-212
lines changed

compilerplugins-BangNotation/src/main/scala/com/thoughtworks/dsl/compilerplugins/BangNotation.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,13 @@ final class BangNotation(override val global: Global) extends Plugin {
279279
if (tpt.tpe.hasAnnotation(resetAnnotationSymbol)) {
280280
continue(exprValue)
281281
} else {
282-
continue(Typed(exprValue, tpt))
282+
tpt match {
283+
case tpt: TypeTree =>
284+
// Remove tpt.original by tree copying, as a workaround of https://github.com/ThoughtWorksInc/Dsl.scala/issues/114
285+
continue(Typed(exprValue, treeCopy.TypeTree(tpt)))
286+
case _ =>
287+
continue(Typed(exprValue, tpt))
288+
}
283289
}
284290
}
285291
}

0 commit comments

Comments
 (0)