Replies: 5 comments
-
|
Beta Was this translation helpful? Give feedback.
-
@YotaXP why not allow it if the compiler can infer that there's only one applicable deconstructor? upd: shouldn't've answered from my phone. I see it's not a deconstructor, it's a typeswitch. |
Beta Was this translation helpful? Give feedback.
-
@gulshan Can you please provide the proposed translation of this construct, as well as some realistic examples that illustrate the need this fulfils? |
Beta Was this translation helpful? Give feedback.
-
I think it's only possible to omit the type argument when it's known to the compiler. |
Beta Was this translation helpful? Give feedback.
-
Named parameters or omission by index looks fine to me. |
Beta Was this translation helpful? Give feedback.
-
Now, type patterns do not work with generic types. A type argument is required to determine actual type. Given the following generic classes (using
closed
andrecord
syntax)-The code I want is write is-
Grammar will be-
Beta Was this translation helpful? Give feedback.
All reactions