Repository navigation
Local lambda parameters (aka stable callsInPlace) #491
Replies: 7 comments 16 replies
I don't see why the rest of the invocation kinds aren't valid here. |
|
|
|
What's the plan w.r.t. eventually getting rid of |
Are there cases where a My understanding is that an existing call that doesn't follow the restrictions in this document is a bug (that the compiler was not yet able to detect). If that's the case, maybe the IDE can be a bit more aggressive? |
|
The nature of the KEEP process means most comments are often complaining about the new proposals; I'd like to say that I really like this KEEP. I think the name |
|
Can a
|
|
There will be functions with parameters that are local but are not marked as such, e.g. because they are from older libraries. What can we do to call them with a |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is a discussion of the design proposal for introducing
localandlocal oncemodifiers on lambda parameters:Essentially, the proposal is about stabilizing the most commonly used and useful part of the callsInPlace contract, addressing limitations of the current approach.
localandlocal onceallows the compiler to perform certain smart-casts and assignments inside such lambdas.This proposal is a logical continuation of the warning on the capture of mutable variables by escaping lambdas: that warning relies on understanding whether a lambda can escape, while this proposal provides a stable way to express that a lambda is local.
Note that this proposal works on top of our control-flow analysis and is compatible with Ross’s proposal, where
localbecomes part of the type system, if we decide to move further in that direction.All reactions