Typed delegate access #468
Replies: 4 comments 6 replies
-
Is it possible to lift this restriction and explicitly allow access in public scope as well? For example, I have DI library which suffers from |
Beta Was this translation helpful? Give feedback.
-
|
How does this work with local delegated properties? My understanding is that property references to them aren't allowed, but they're also effectively "private", so it'd be nice (especially for DSLs) to be able to access the delegate in this way. There are many example use cases here. Obviously, |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure I'm sold on using |
Beta Was this translation helpful? Give feedback.
-
|
This looks great, I have definitely wanted something like this a number of times. My biggest concern is the different runtime behavior between JVM and other platforms shown in the "Behavior in different scopes" section. This is an easy to run into footgun. I'm guessing it occurs because the delegate field is private? IMO, the behavior should be consistent across all platforms, even if it limits the functionality. I would think this either means that bridges need to be generated for delegates (don't know how much overhead that adds) or that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is an issue to discuss typed delegate access. The current full text of the proposal can be found here.
This proposal describes a way to access a typed value of a delegate within the private scope:
Beta Was this translation helpful? Give feedback.
All reactions