LDM Notes for February 1st, 2023 #6978
Replies: 5 comments 1 reply
-
I feel like there's a slight discrepancy between:
and:
Assuming I have the following setup for phase C: class Foo { ... }
extension FooExtension : Foo, ICloneable { ... }
class Please
{
public static bool Clone<TCloneable>(TCloneable obj) where TCloneable : ICloneable { ...}
} Based on the first quote, I would expect to be able to call The second quote indicates that instead I would need to call Which direction would phase C be heading in, and why? |
Beta Was this translation helpful? Give feedback.
-
Looking at the note for the roles WG something doesn't make sense to me: The intent is to emit In phase C though you want to allow a Role to implement an interface. So if I have |
Beta Was this translation helpful? Give feedback.
-
This is a bit surprise. While roles have types and can even implement interfaces in phase "C", they cannot be type-tested? |
Beta Was this translation helpful? Give feedback.
-
It could be nice to have a feature to check if a type can be casted to a role Email for string
{
public static bool Validate(string s)
=> // Check if the string is an e-mail
public URI Domain => // part of e-mail after the @
public void Send(string message)
=> // Send the message to the e-mail
}
if ("[email protected]" is Email { Domain: var domain } mail) // calls the Validate method
// Do something with the mail and domain |
Beta Was this translation helpful? Give feedback.
-
I love reading the LDM notes and have done so for years. I have to say though that Roles is the first major feature in them that I don't yet get. I'd love to see more real-world examples of it so that I can really get it and begin to follow along the decisions being made. |
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/2023/LDM-2023-02-01.md
Agenda
Beta Was this translation helpful? Give feedback.
All reactions