Skip to content

Commit

Permalink
Ignore function type refs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBakerEffendi committed Nov 10, 2023
1 parent 168b56a commit 6f243b5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class PythonImportResolverPass(cpg: Cpg) extends XImportResolverPass(cpg) {
moduleMethod.astChildren.foreach {
case moduleFunction: Method =>
moduleCache.put(s"$modulePath.${moduleFunction.name}", ImportableFunction(moduleFunction))
case moduleType: TypeDecl => moduleCache.put(s"$modulePath.${moduleType.name}", ImportableType(moduleType))
case _ => // do nothing
// Ignore types for functions that are used for method pointers
case moduleType: TypeDecl if moduleMethod.astChildren.isMethod.fullNameExact(moduleType.fullName).isEmpty =>
moduleCache.put(s"$modulePath.${moduleType.name}", ImportableType(moduleType))
case _ => // do nothing
}
}
moduleType.member.foreach { moduleMember =>
Expand Down

0 comments on commit 6f243b5

Please sign in to comment.