[D-runtime] What is a hidden function?

Alex Rønne Petersen xtzgzorex at gmail.com
Fri May 11 14:55:04 PDT 2012


See: https://github.com/D-Programming-Language/dmd/blob/master/src/toobj.c#L826

Since these cases are statically disallowed entirely, I don't think we
need anything in the runtime for it anymore.

Regards,
Alex

On Fri, May 11, 2012 at 11:47 PM, Sean Kelly <sean at invisibleduck.org> wrote:
> 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
>
> _______________________________________________
> 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