Re: Package and virtual functions

2012-06-13 Thread Jonathan M Davis
On Thursday, June 14, 2012 08:30:26 Jacob Carlborg wrote: > On 2012-06-14 00:48, Jonathan M Davis wrote: > > On Thursday, June 14, 2012 00:32:45 BLM768 wrote: > >> For some reason, whenever I declare a method with package > >> visibility, it becomes non-virtual. Is this normal behavior, or > >> is

Re: Package and virtual functions

2012-06-13 Thread Jacob Carlborg
On 2012-06-14 00:48, Jonathan M Davis wrote: On Thursday, June 14, 2012 00:32:45 BLM768 wrote: For some reason, whenever I declare a method with package visibility, it becomes non-virtual. Is this normal behavior, or is there a bug in DMD 2.059? Only public and protected functions can be virtu

Re: Package and virtual functions

2012-06-13 Thread Timon Gehr
On 06/14/2012 01:57 AM, BLM768 wrote: I guess that another solution to this whole mess is to just start requiring the use of override; then everyone would be educated and it would be obvious where the bug is in the code I posted. Since we don't want to break code, though, maybe there should be a

Re: Package and virtual functions

2012-06-13 Thread BLM768
I guess that another solution to this whole mess is to just start requiring the use of override; then everyone would be educated and it would be obvious where the bug is in the code I posted. Since we don't want to break code, though, maybe there should be a message prominently displayed on the

Re: Package and virtual functions

2012-06-13 Thread BLM768
True, but it will be explicit in the derived class code: No 'override', no function that is overridden. However, if a programmer expects it to override, there could be an issue. Imagine a novice D programmer who is not used to using "override" and looks at at the following code: class Bas

Re: Package and virtual functions

2012-06-13 Thread Jonathan M Davis
On Thursday, June 14, 2012 01:34:42 BLM768 wrote: > > override will eventually be required when overriding a > > function. It is already > > if you compile with -w but not yet all of the time - though > > since protected > > isn't virtual and isn't really overriding anything, the > > compiler doesn

Re: Package and virtual functions

2012-06-13 Thread Timon Gehr
On 06/14/2012 01:34 AM, BLM768 wrote: override will eventually be required when overriding a function. It is already if you compile with -w but not yet all of the time - though since protected isn't virtual and isn't really overriding anything, the compiler doesn't complain if you don't use ov

Re: Package and virtual functions

2012-06-13 Thread BLM768
override will eventually be required when overriding a function. It is already if you compile with -w but not yet all of the time - though since protected isn't virtual and isn't really overriding anything, the compiler doesn't complain if you don't use override with it (though it will if y

Re: Package and virtual functions

2012-06-13 Thread Jonathan M Davis
On Thursday, June 14, 2012 01:07:17 BLM768 wrote: > On Wednesday, 13 June 2012 at 22:48:34 UTC, Jonathan M Davis > > wrote: > > On Thursday, June 14, 2012 00:32:45 BLM768 wrote: > >> For some reason, whenever I declare a method with package > >> visibility, it becomes non-virtual. Is this normal b

Re: Package and virtual functions

2012-06-13 Thread BLM768
On Wednesday, 13 June 2012 at 22:48:34 UTC, Jonathan M Davis wrote: On Thursday, June 14, 2012 00:32:45 BLM768 wrote: For some reason, whenever I declare a method with package visibility, it becomes non-virtual. Is this normal behavior, or is there a bug in DMD 2.059? Only public and protected

Re: Package and virtual functions

2012-06-13 Thread Jonathan M Davis
On Thursday, June 14, 2012 00:32:45 BLM768 wrote: > For some reason, whenever I declare a method with package > visibility, it becomes non-virtual. Is this normal behavior, or > is there a bug in DMD 2.059? Only public and protected functions can be virtual. private and package functions are neve