File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -210,9 +210,16 @@ object TreeTransforms {
210
210
*/
211
211
class NXTransformations {
212
212
213
- private def hasRedefinedMethod (cls : Class [_], name : String ): Boolean =
214
- if (cls.getDeclaredMethods.exists(_.getName == name)) cls != classOf [TreeTransform ]
215
- else hasRedefinedMethod(cls.getSuperclass, name)
213
+ private def hasRedefinedMethod (cls : Class [_], name : String ): Boolean = {
214
+ val clsMethods = cls.getDeclaredMethods
215
+ var i = clsMethods.length - 1
216
+ while (i >= 0 ) {
217
+ if (clsMethods(i).getName == name)
218
+ return cls != classOf [TreeTransform ]
219
+ i -= 1
220
+ }
221
+ hasRedefinedMethod(cls.getSuperclass, name)
222
+ }
216
223
217
224
/** Create an index array `next` of size one larger than the size of `transforms` such that
218
225
* for each index i, `next(i)` is the smallest index j such that
You can’t perform that action at this time.
0 commit comments