clemos / try-haxe

A small webapp that allows to test Haxe online
https://try.haxe.org
MIT License
126 stars 41 forks source link

interface cannot be the first declared thing #128

Closed binki closed 7 years ago

binki commented 7 years ago

This fails to run:

http://try.haxe.org/#29Db3

interface IThing {}

class Thing implements IThing {
    public function new() {
    }
    public function act() {
        trace('hi');
    }
}

class Test {
    static function main() {
        new Thing();
    }
}
Test.hx:7: characters 2-11 : Unexpected interface

However, the following works:

http://try.haxe.org/#676ae

class Thing implements IThing {
    public function new() {
    }
    public function act() {
        trace('hi');
    }
}

class Test {
    static function main() {
        new Thing();
    }
}

interface IThing {}

On my local install of haxe-3.4.0rc1 and I just installed haxe-3.3.0rc1 to verify too, both variants work.

This is confusing. If http://try.haxe.org/ fails, I’d expect the CLI compiler to fail too (when targeting JS).

clemos commented 7 years ago

It works now, thank for reporting :)