WurstScript
WurstScript copied to clipboard
Unable to create constructor for a derived generic class
I am trying to extend LLIterator<T> found in LinkedList.wurst and it does not seem to accept what looks like a well-formed constructor.
package ListIterator
import LinkedList
public class ListIterator<T> extends LLIterator<T>
construct(LinkedList<T> parent)
super(parent)
Error: Incorrect call to super constructor: Expected LinkedList<T> as parameter 1 but found LinkedList<T> Wurst
Another example:
// ============================================================================
public abstract class BaseNode<T>
private BaseNode<T> _parent
private T _data
// --------------------------------------------------------------------------
construct (BaseNode<T> parent, T data)
_parent = parent
_data = data
// ============================================================================
public class MyCustomData
int foobar
// ============================================================================
public class MyCustomNode extends BaseNode<MyCustomData>
// --------------------------------------------------------------------------
construct (MyCustomNode parent, MyCustomData data)
super(parent, data)
Incorrect call to super constructor: Expected BaseNode<T> as parameter 1 but found MyCustomNode
Incorrect call to super constructor: Expected T as parameter 2 but found MyCustomData