Error: hidden method called for ports.OutBound

Steven Schveighoffer schveiguy at yahoo.com
Thu May 8 08:24:59 PDT 2008


"D newb" wrote
> When I run my program I get the following output:
>
> Error: hidden method called for ports.OutBound
>
> How do I know which is the hidden function call? I tried ddbg but it won't 
> allow me to insert commands after the error.
>
> OutBound is a sub-class of Port which in turn is a subclass of Thread.

This is due to the class OutBound overriding a function from Port or Thread, 
but not overriding all overloads.

For example:

class A
{
    void foo(){}
}

class B: A
{
   void foo(int x){}
   // didn't override foo(), so it is a hidden function
}

A a = new B;
a.foo(); // throws hidden func error.

To rectify this situation, have B overload foo(), or alias A's foo into B:

class B : A
{
   void foo() {}
   void foo(int x) {}
}

or

class B : A
{
   alias A.foo foo;
   void foo(int x) {}
}

You need to translate to your specific class hierarchy.

-Steve 




More information about the Digitalmars-d-learn mailing list