Re: Is there any way to define an interface that can implicitly convert to Object?

2019-07-10 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 10 July 2019 at 08:03:30 UTC, Nathan S. wrote: I want to be able to do things like: --- bool isSame(Object a, Object b) { return a is b; } interface SomeInterface { int whatever(); } bool failsToCompile(SomeInterface a, SomeInterface b) { return isSame(a, b); } --- Error: func

Is there any way to define an interface that can implicitly convert to Object?

2019-07-10 Thread Nathan S. via Digitalmars-d-learn
I want to be able to do things like: --- bool isSame(Object a, Object b) { return a is b; } interface SomeInterface { int whatever(); } bool failsToCompile(SomeInterface a, SomeInterface b) { return isSame(a, b); } --- Error: function isSame(Object a, Object b) is not callable using argumen