sergiotaborda / lense-lang

The Lense Language Compiler
1 stars 0 forks source link

Handle super Constructor delegation #12

Open sergiotaborda opened 8 years ago

sergiotaborda commented 8 years ago

A constructor always must call another constructor until the primary constructor is called. When A inherits from B the constructor of B must be called at some point in the chain. The programmer may explicitly declare where the super constructor should be called

class A extends B {

constructor A () extends B()

}

(in java backend constructors are final static methods )

Is necessary to define how to access the object the super constructor created

sergiotaborda commented 6 years ago

Constructor extensions cannot call methods (currently). Data must be passed directly.

public class AssertionException extends Exception {

    public constructor ();

    public constructor (message : String) extends super (message); 
}

named constructors must be handled