[D-runtime] What is a hidden function?

Sean Kelly sean at invisibleduck.org
Fri May 11 14:47:37 PDT 2012


I think it should be a compile error, if possible.  But for complex class hierarchies, it may not be.  The idea came from MSVC, which default initializes vtbl entries to call a functionNotDefined routine that throws.  The alternative would be something fun like a bus error if this default method didn't exist.


On May 11, 2012, at 12:38 PM, Steve Schveighoffer wrote:

> class A
> {
>    void hiddenFunction(int x);
> }
> 
> class B : A
> {
>    void hiddenFunction(long x);  // does not override A.hiddenFunction!
> }
> 
> B b = new B;
> A a = b;
> 
> b.hiddenFunction(1); // ok, does not call A.hiddenFunction
> a.hiddenFunction(1); // error, hiddenFunction exception thrown.
> 
> At least, this is what it used to mean.  I think Andrei wanted this to be a compile-time error, but I'm not sure if it is yet.
> 
> -Steve
> 
> From: Alex Rønne Petersen <xtzgzorex at gmail.com>
> To: D's runtime library developers list <d-runtime at puremagic.com> 
> Sent: Friday, May 11, 2012 3:13 PM
> Subject: [D-runtime] What is a hidden function?
> 
> Hi,
> 
> I just noticed the onHiddenFuncError(Object o) function. However, I
> can't seem to figure out what on earth a hidden function is. Anyone
> know?
> 
> Regards,
> Alex
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime
> 
> 
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime



More information about the D-runtime mailing list