LDM Notes for January 22nd, 2024 #7877
Replies: 6 comments 15 replies
-
Are there any security concerns around interceptors? From the way I interpreted their original description, it seems like a malicious programmer could use them to hijack the definition of an internal function. |
Beta Was this translation helpful? Give feedback.
-
With ref strict, I'm not a fan of the allows syntax but do like combining it with where. I suggest allowing a : ref struct syntax and also an OR operator. Any of the following would become valid: Where T : class Where T : ref struct Where T : class or ref struct |
Beta Was this translation helpful? Give feedback.
-
When it comes to the “unknown unknowns” with genetics, I think public static IEnumerable<TTo> Select<TFrom, TTo>(this IEnumerable<TFrom> values, Func<TFrom, TTo> selector)
allow T : stackonly,
allow T : stackonly
{
if (TFrom is stackonly || TTo is stackonly)
{
return StackOnlySelect(values, selector);
}
return ExistingSelectImplementation(values, selector);
} The syntax is my personal strawman but the important thing is what this lets us do. This will allow stack-only types to participate in LINQ and in the overwhelming majority of generic methods or types, as long as a stack-only implementation is somehow possible. |
Beta Was this translation helpful? Give feedback.
-
The syntax seems to be a big source of bikeshedding, I’d like to propose a “nuclear option” which is the least obstructive: public void <[AllowRefStructs] T> M() { } The LDM mentioned leaving room for future public void <[GenericAllows(AllowConstaints.RefStructs)] T> M() { } Attribute name itself is up for discussion of course but I haven’t seen anyone bring up this approach. There’s plenty of prior art for making attributes affect the language, such as |
Beta Was this translation helpful? Give feedback.
-
Does this mean that adding (and perhaps removing) this modifier would not be a binary breaking change? |
Beta Was this translation helpful? Give feedback.
-
Sorry if i wrong, |
Beta Was this translation helpful? Give feedback.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2024/LDM-2024-01-22.md
Agenda
Beta Was this translation helpful? Give feedback.
All reactions