Skip to content

Commit 9e1a5d8

Browse files
authored
Remove unnecessary guard in TreeMap (#18368)
This guard was added in fb09e82 but does not seem to be necessary. Note that `UntypedTreeMap` handles the case `DerivingTemplate` explicitly.
2 parents 5eeac92 + 7dd263d commit 9e1a5d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,9 @@ object Trees {
15961596
case tree @ TypeDef(name, rhs) =>
15971597
cpy.TypeDef(tree)(name, transform(rhs))
15981598
case tree @ Template(constr, parents, self, _) if tree.derived.isEmpty =>
1599+
// Currently we do not have cases where we expect `tree.derived` to contain trees for typed trees.
1600+
// If it is the case we will fall in `transformMoreCases` and throw an exception there.
1601+
// In the future we might keep the `derived` clause after typing, in that case we might want to start handling it here.
15991602
cpy.Template(tree)(transformSub(constr), transform(tree.parents), Nil, transformSub(self), transformStats(tree.body, tree.symbol))
16001603
case Import(expr, selectors) =>
16011604
cpy.Import(tree)(transform(expr), selectors)

0 commit comments

Comments
 (0)