Skip to content

Commit

Permalink
Update on "[compiler] Track refs through object expressions and prope…
Browse files Browse the repository at this point in the history
…rty lookups"

Summary:
This addresses the issue of the compiler being overly restrictive about refs escaping into object expressions. Rather than erroring whenever a ref flows into an object, we will now treat the object itself as a ref, and apply the same escape rules to it. Whenever we look up a property from a ref value, we now don't know whether that value is itself a ref or a ref value, so we assume it's both.

The same logic applies to ref-accessing functions--if such a function is stored in an object, we'll propagate that property to the object itself and any properties looked up from it.

[ghstack-poisoned]
  • Loading branch information
mvitousek committed Aug 27, 2024
2 parents be7e97a + e09c8a7 commit 8c49c8f
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 350 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
IdentifierId,
Place,
SourceLocation,
isRefOrRefValue,
isRefValueType,
isUseRefType,
} from '../HIR';
Expand Down
Loading

0 comments on commit 8c49c8f

Please sign in to comment.