LDM notes for July 30th, 2025 #9571
Replies: 3 comments 11 replies
-
I'd love the runtime to weigh in on what kind of effort/time would be required to have runtime support for I understand some of the concerns around GVM, but does support for those patterns extend to interfaces and generic constraints so that I could define my own // have a couple of these interfaces up to a certain arity
public interface IUnionUnboxed<T1, T2> {
bool TryGetValue(out T1 value);
bool TryGetValue(out T2 value);
}
public struct MyUnion : IUnion, IUnionUnboxed<int, DateTime> {
object? IUnion.Value { get { ... } }
public bool TryGetValue(out int value) { ... }
public bool TryGetValue(out DateTime value) { ... }
} |
Beta Was this translation helpful? Give feedback.
-
What's the design/decision for the relation between union and nullable? e.g.
|
Beta Was this translation helpful? Give feedback.
-
When did LDT adopt the closed enums proposal? Last update we had it was still a proposal. I still think you guys are making an unforced error in not allowing the switch over closed enums to catch invalid values of the enum. closed enum Dog { Lassie, Rover, Fido }
var json = "-1";
var myDog = JsonConvert.Deserialize<Dog>(json); //Illustrative syntax, I know the actual json libraries are slightly different from this
switch (myDog) {
case Lassie: ...
case Rover: ...
case Fido: ...
}
// I now get here with *no* compiler warning, when in fact my code has a serious bug in it. This feature is building a new footgun into the language. It is definitely not a pit of success. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-07-30.md
Agenda
Beta Was this translation helpful? Give feedback.
All reactions