Open AjaniBilby opened 3 months ago
This is currently a low priority issue as there is no concept of disposing or drop
ing a value currently in the language, however it is a conceptual problem with the current direction that must be considered
This should also be accounted for in structure production:
let a: Foo = [
.bar = "thing",
.baz = { if maybe() return; else lift "valid"; }
.bing = "more
];
If it returns during the construction of baz
then bar
needs to be cleaned up, but not bing
.
This also needs to account for nesting
Since we can have {} almost anywhere as a new block scope which can then resolve to a value which, so that entire block can be used as an expression.
This lead to a potential issue with early exit?
For instance with the line:
There is a potential situation where
a
is either consumed by foo, or nothing is done, because during the evaluation of the second argument the function returns. What then happens toa
?We need to be able to track floating values, so that in the event on an early return, these floating values are safely disposed. This also must account for nesting, i.e.