www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Error: hidden method called for ports.OutBound

reply D newb <as asg.oe> writes:
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.
May 08 2008
next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
"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
May 08 2008
prev sibling parent Pedro Ferreira <ask me.pt> writes:
D newb escreveu:
 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.

Try compiling with "-w". That should warn you about calling hidden methods.
May 08 2008