@Mara I find it kind of weird that the extended lifetime annotation (i.e. `super`) ends up on the let binding, and not on the temporary whose lifetime will be extended
Top-level
3 comments
@swiftcoder Ah. Well, both? `super let a = Thing;` makes `a` live as long as the surrounding block. The lifetime that allows the block's final expression to be `&a`, basically. On top of that, we still have temporary lifetime extension, just like we have in a regular `let`: `let a = &temp();` makes the temporary life as long as `a`. Same for `super let a = &temp();`: the temporary will live as long as `a` (which might live longer than it would have in a regular `let`). |
@swiftcoder Huh? The let binding is for the value that will be lifetime-extended. (It's no longer a "temporary" because it now has a name.)