3 ms·
"However, in Go, any type which provides the methods named in the interface may be treated as an implementation of the interface" I've been wanting this in C#
by euroclydon 17y ago
"However, in Go, any type which provides the methods named in the interface may be treated as an implementation of the interface"
I've been wanting this in C# for a while now. Maybe one day...
- AndrewDucker 17y agoYeah, I'd kill for Duck Typing in C#.
- nailer 17y agoIronPython is duck typed and runs on the DLR. The same should be possible for a future C#...
- euroclydon 17y agoI never knew what duck typing referred to. Thanks.
- mbreese 17y ago(possibly redundant) It's based upon the phrase: if it looks like a duck and quacks like a duck, it's a duck. In this case, if the object has the methods of the duck interface, treat it like a duck object.