Implementing Interface's method on Union state #745
Unanswered
ericodarmawanh
asked this question in
Q&A
Replies: 1 comment
-
|
Hello! Yes, there's no choice. If the getMessage wasn't part of the IError interface, you could use an extension instead. But because of the interface, you'll have to it as you've shown. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say that I have an interface IError which has a method to implement like this:


Now, one of my Union's state implements it. The question is: Is this the right way to implement the method? I doubt my self because now the success state has the method too. It's happened because I create the method inside the Union class.
Thank you for the answer.
Beta Was this translation helpful? Give feedback.
All reactions