Replies: 9 comments 31 replies
-
For the WinForms etc collections, I vote option 2 - very strange to modify the language because of a few very old types, which need to be updated anyway. |
Beta Was this translation helpful? Give feedback.
-
Just wondering whether the keyword |
Beta Was this translation helpful? Give feedback.
-
For flow of allow/allows, I can think of two conceptualizations that make sense to me when reading aloud:
The first form would be read without a pause, and the second form would be read with a pause at the comma. But now let's consider
The thing that feels the most streamlined and least contrived to me is strategy 1. |
Beta Was this translation helpful? Give feedback.
-
Probably important to look at the "anti-constraint" in the context of being combined with other constraints as well, as I can see that being a common use case (particularly with specific interfaces): where T : allows ref struct, IDisposable
// or
where T : allows ref struct, struct, IDisposable
// or
where T : struct, allows ref struct, IDisposable |
Beta Was this translation helpful? Give feedback.
-
As a non-fusional language speaker, |
Beta Was this translation helpful? Give feedback.
-
It is true that this is an anti-constraint - allowing more types to be used rather than less, but it still limits the lifetime? I remember a proposal for lifetime annotations, isn't that going to happen? (even as a subset, but I think that could drive the syntax form)
The proposal mentions this as a motivation but this feature would not enable that unless the method takes a generic parameter. Wouldn't it make sense to wait for extensions to implement interfaces on ref structs? As per the last discussions I think they would always require a generic parameter. I'm looking out for |
Beta Was this translation helpful? Give feedback.
-
I don’t like this syntax much. Why can we just have more flexible constraints like:
and maybe in the future even like:
|
Beta Was this translation helpful? Give feedback.
-
Another possible "anti-constraint" that came up on Discord was one that, when combined with the /cc @IS4Code |
Beta Was this translation helpful? Give feedback.
-
The "2023" in the title ( |
Beta Was this translation helpful? Give feedback.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2024/LDM-2024-02-26.md
Agenda
ref struct
s in genericsBeta Was this translation helpful? Give feedback.
All reactions