Skip to content

Commit

Permalink
Add comment on Template case of TreeMap
Browse files Browse the repository at this point in the history
[Cherry-picked 7dd263d]
  • Loading branch information
nicolasstucki authored and Kordyjan committed Dec 7, 2023
1 parent 44d5ada commit 0c0b48d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,9 @@ object Trees {
case tree @ TypeDef(name, rhs) =>
cpy.TypeDef(tree)(name, transform(rhs))
case tree @ Template(constr, parents, self, _) if tree.derived.isEmpty =>
// Currently we do not have cases where we expect `tree.derived` to contain trees for typed trees.
// If it is the case we will fall in `transformMoreCases` and throw an exception there.
// In the future we might keep the `derived` clause after typing, in that case we might want to start handling it here.
cpy.Template(tree)(transformSub(constr), transform(tree.parents), Nil, transformSub(self), transformStats(tree.body, tree.symbol))
case Import(expr, selectors) =>
cpy.Import(tree)(transform(expr), selectors)
Expand Down

0 comments on commit 0c0b48d

Please sign in to comment.