-
I noticed today that pattern matching class M {
public static implicit operator string(M value) => "";
public bool P {get;set;}
void B(M m) {
switch (m) {
case M1 { P: true } : break;
case M2 : break;
}
}
}
class M1 : M {}
class M2 : M {}
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This feels like it might be legacy |
Beta Was this translation helpful? Give feedback.
This feels like it might be legacy
switch
baggage, in that it used to allow expressions to be used inswitch
statements that were implicitly converted tostring
before pattern matching existed?