Skip to content

Commit

Permalink
Try to improve precision of reachability analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
b-studios committed Dec 24, 2024
1 parent 38a96a0 commit e40edb7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions effekt/shared/src/main/scala/effekt/core/Reachable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ class Reachable(
definitions.foreach {
case d: Definition.Def =>
currentDefs += d.id -> d // recursive
process(d)(using currentDefs)
// Do NOT process them here, since this would mean the definition is used
// process(d)(using currentDefs)
case d: Definition.Let =>
process(d)(using currentDefs)
// DO only process if NOT pure
if (d.binding.capt.nonEmpty) {
process(d)(using currentDefs)
}
currentDefs += d.id -> d // non-recursive
}
process(body)(using currentDefs)
Expand Down

0 comments on commit e40edb7

Please sign in to comment.