kitlang / kit

Kit: a magical, high performance programming language, designed for game development.
https://www.kitlang.org
Other
1.02k stars 29 forks source link

Invalid code generated when implementing trait for another trait #96

Closed bendmorris closed 5 years ago

bendmorris commented 5 years ago

If this is a code issue, provide a minimal code example:

trait MyTrait;

trait OtherTrait {
    function getHash(): Int;
}

implement MyTrait for Int;
implement MyTrait for Char;

implement OtherTrait for MyTrait {
    function getHash() {
        return this;
    }
}

function main() {
    var i: Int = 1;
    var c: Char = 2;
    printf("%i %i\n", i.OtherTrait.getHash(), c.OtherTrait.getHash());
}