File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -142,16 +142,16 @@ trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] =>
142
142
143
143
/** All term arguments of an application in a single flattened list */
144
144
def allTermArguments (tree : Tree ): List [Tree ] = unsplice(tree) match {
145
- case Apply (fn, args) => allTermArguments(fn) ::: args.map(stripNamedArg)
145
+ case Apply (fn, args) => allTermArguments(fn) ::: args
146
146
case TypeApply (fn, args) => allTermArguments(fn)
147
147
case Block (Nil , expr) => allTermArguments(expr)
148
148
case _ => Nil
149
149
}
150
150
151
151
/** All type and term arguments of an application in a single flattened list */
152
152
def allArguments (tree : Tree ): List [Tree ] = unsplice(tree) match {
153
- case Apply (fn, args) => allArguments(fn) ::: args.map(stripNamedArg)
154
- case TypeApply (fn, args) => allArguments(fn) ::: args.map(stripNamedArg)
153
+ case Apply (fn, args) => allArguments(fn) ::: args
154
+ case TypeApply (fn, args) => allArguments(fn) ::: args
155
155
case Block (Nil , expr) => allArguments(expr)
156
156
case _ => Nil
157
157
}
Original file line number Diff line number Diff line change @@ -160,14 +160,13 @@ extension (tree: Tree)
160
160
refs
161
161
162
162
/** The arguments of a @retains, @retainsCap or @retainsByName annotation */
163
- def retainedElems (using Context ): List [Tree ] =
164
- tpd.allTermArguments(tree) match
165
- case List (Typed (SeqLiteral (elems, _), _)) =>
166
- elems
167
- case _ =>
168
- if tree.symbol.maybeOwner == defn.RetainsCapAnnot
169
- then ref(defn.captureRoot.termRef) :: Nil
170
- else Nil
163
+ def retainedElems (using Context ): List [Tree ] = tree match
164
+ case Apply (_, Typed (SeqLiteral (elems, _), _) :: Nil ) =>
165
+ elems
166
+ case _ =>
167
+ if tree.symbol.maybeOwner == defn.RetainsCapAnnot
168
+ then ref(defn.captureRoot.termRef) :: Nil
169
+ else Nil
171
170
172
171
extension (tp : Type )
173
172
You can’t perform that action at this time.
0 commit comments