The interface's 'in' contract passes if it makes a virtual function call

2014-11-04 Thread Ali Çehreli via Digitalmars-d-learn
Perhaps I am expecting too much from the current 'in' contract design and implementation. ;) Still, the virtual function call in the following interface's 'in' contract should be dispatched to the implementaion in the derived class, right? It seems like mere presence of that virtual

Re: The interface's 'in' contract passes if it makes a virtual function call

2014-11-04 Thread bearophile via Digitalmars-d-learn
Ali Çehreli: Perhaps I am expecting too much from the current 'in' contract design and implementation. ;) The in contract is named pre-condition, or precondition. Bye, bearophile

Re: The interface's 'in' contract passes if it makes a virtual function call

2014-11-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/4/14 3:01 PM, Ali Çehreli wrote: Perhaps I am expecting too much from the current 'in' contract design and implementation. ;) Still, the virtual function call in the following interface's 'in' contract should be dispatched to the implementaion in the derived class, right? It seems like

Re: The interface's 'in' contract passes if it makes a virtual function call

2014-11-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/4/14 3:26 PM, Steven Schveighoffer wrote: On 11/4/14 3:01 PM, Ali Çehreli wrote: Perhaps I am expecting too much from the current 'in' contract design and implementation. ;) Still, the virtual function call in the following interface's 'in' contract should be dispatched to the

Re: The interface's 'in' contract passes if it makes a virtual function call

2014-11-04 Thread Ali Çehreli via Digitalmars-d-learn
On 11/04/2014 12:41 PM, Steven Schveighoffer wrote: Yep. I debugged it. It's calling toHash instead. Yeah, you were spot on. :) I did a different experiment. I added a number of functions to the interface (before virtualCheck()) and implementations to the class: interface I { // ...

Re: The interface's 'in' contract passes if it makes a virtual function call

2014-11-04 Thread Ali Çehreli via Digitalmars-d-learn
On 11/04/2014 12:26 PM, Steven Schveighoffer wrote: This looks like a dmd bug. Posted: https://issues.dlang.org/show_bug.cgi?id=13687 Ali