Skip to content

Commit bfe4ad1

Browse files
VLanvinfacebook-github-bot
authored andcommitted
Load AST from ETF for project apps
Summary: Do not load AST from Beam files in case of OTP modules or 3rd party dependencies if the module is also present in a project app. Reviewed By: ilya-klyuchnikov Differential Revision: D41265141 fbshipit-source-id: 9e1634cdac0eab4177794caeb9da2399084a3d70
1 parent 9e3e9a5 commit bfe4ad1

File tree

1 file changed

+3
-1
lines changed
  • eqwalizer/src/main/scala/com/whatsapp/eqwalizer/ast/stub

1 file changed

+3
-1
lines changed

eqwalizer/src/main/scala/com/whatsapp/eqwalizer/ast/stub/Db.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ private object Db {
3636
otpApps.values.flatMap(_.modules).toSet
3737
lazy val projectApps: Map[String, App] =
3838
config.apps.map { case (n, ai) => n -> App(n, ai.ebin, erlModules(ai), hasEqwalizerMarker(ai)) }
39+
lazy val projectModules: Set[String] =
40+
projectApps.values.flatMap(_.modules).toSet
3941
lazy val depApps: Map[String, App] =
4042
config.deps.map { case (n, ai) => n -> App(n, ai.ebin, erlModules(ai), hasEqwalizerMarker = false) }
4143
lazy val depModules: Set[String] =
@@ -170,7 +172,7 @@ private object Db {
170172
}
171173

172174
def fromBeam(module: String): Boolean =
173-
otpModules(module) || depModules(module) || !config.useElp
175+
((otpModules(module) || depModules(module)) && !projectModules(module)) || !config.useElp
174176

175177
// $COVERAGE-OFF$
176178
private val generatedMark: String = "@" + "generated"

0 commit comments

Comments
 (0)