Interface "Implemented Member" Implementation should be smarter #1144
Replies: 5 comments
-
Why would you want to do this? I can't see any benefit at all to having the class provide a different implementation signature to the interface. |
Beta Was this translation helpful? Give feedback.
-
Duplicate of #49, I believe. |
Beta Was this translation helpful? Give feedback.
-
Because if you are working with an instance of my interface, I want to provide additional information that the interface itself might not expose. In order to make the above work, I have to do something like this and it isn't so tidy. It should just be automatic:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Can you be more precise. What are the exact rules around which such members are generated? For example, say i have the following: interface IFoo {
int Foo { get; }
}
class C : IFoo {
short Foo { get; }
} Should that be allowed? What about user defined operators? etc. etc. In other words, what sorts of conversions should be allowed between the values in the bridge-member and the member the user created? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When implementing an interface, I should be able to return members that have a derived type of the specified type. IE:
In order to make the above work, I have to do something like this:
Beta Was this translation helpful? Give feedback.
All reactions