Home /Modules/tests/constructor-overload-unsupported.sleela

constructor-overload-unsupported.sleela

tests/sleela-syntax-1.8/constructor-overload-unsupported.sleela · 21 line(s) · sleela

#sleela 2.1
class Pair {
    int a;
    int b;

    Pair(int x) {
        this.a = x;
        this.b = x;
    }

    Pair(int x, int y) {
        this.a = x;
        this.b = y;
    }

    static void main() {
        Pair p = new Pair(1, 2);
        print(p.a);
    }
}