Lifetime Issues #11
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Current Implementation
Runs after type checking, before IR generation.
Ideas:
Solution: Ensures outlive relationship between LHS and RHS.
Solution: Only allow returning values that live forever.
Solution: Disallow returning exceptions that refer to mutable data.
Currently very buggy:
Long standing issue, fix is simple but is not yet fixed because global lifetime needs special handling.
Issue found today after reading the code. The lifetime of different parameters should be incomparable instead of the same, as they can come from different callers.
Also found today... This would also affects object with fields.
a
Lifetime: Global / Local (selected with if expression).b
Lifetime: Local.a
is considered as local.a.foo = b
is now legal asb
outlives local lifetime.The later 3 bugs probably require algorithmic changes, simple fixes are not sufficient.
Other Ideas
We probably want a sound system with less restrictive lifetime.