Replies: 2 comments 3 replies
-
Can you please provide a copy of your code and a copy of the diagnostic message you're getting? |
Beta Was this translation helpful? Give feedback.
-
From https://github.com/dotnet/csharplang/blob/master/spec/statements.md#the-switch-statement
When we added pattern-matching we changed the "compile-time error occurs" to being permitted. That's pretty much always what we like to do when adding language features: take conditions that used to be errors and giving them new meaning. But your code falls into the second bullet, which establishes the governing type to be the result of the conversion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For the same statement, if you use switch to express that it is OK, but if you use switch statement, you will recived an error cs8121
Beta Was this translation helpful? Give feedback.
All reactions