File tree Expand file tree Collapse file tree 2 files changed +166
-119
lines changed Expand file tree Collapse file tree 2 files changed +166
-119
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,26 @@ private module Cached {
138138 cached
139139 string resolveConstantWrite ( ConstantWriteAccess c ) { result = resolveConstantWriteAccess ( c ) }
140140
141+ /**
142+ * Gets a method named `name` that is available in module `m`. This includes methods
143+ * that are included/prepended into `m` and methods available on base classes of `m`.
144+ */
141145 cached
142146 Method lookupMethod ( Module m , string name ) { TMethod ( result ) = lookupMethodOrConst ( m , name ) }
143147
148+ /**
149+ * Gets a method named `name` that is available in a sub class of module `m`. This
150+ * includes methods that are included/prepended into any of the sub classes of `m`,
151+ * but not methods inherited from base classes.
152+ */
153+ cached
154+ Method lookupMethodInSubClasses ( Module m , string name ) {
155+ exists ( Module sub | sub .getSuperClass ( ) = m |
156+ TMethod ( result ) = lookupMethodOrConst0 ( sub , name ) or
157+ result = lookupMethodInSubClasses ( sub , name )
158+ )
159+ }
160+
144161 cached
145162 Expr lookupConst ( Module m , string name ) {
146163 TExpr ( result ) = lookupMethodOrConst ( m , name )
You can’t perform that action at this time.
0 commit comments