[ENHANCEMENT] Allow interfaces to be parsed and no longer throw errors when they exist in scripts.#284
Conversation
74e5c05 to
927ab60
Compare
|
Copy paste from the hscript PR: class Test {
static function main() {
var test = new TestClass();
trace(TestClass.id);
trace(test.nr);
trace(test.test());
}
}
class TestClass implements TestInterface {
var name:String = "class";
public static final id:Int = 1;
public var nr:Int = 90;
public function new() {}
public function test():String {
return "TEST";
}
}
extern interface TestInterface extends TestInterfaceTwo {
private var name:String;
static final id:Int;
var nr:Int;
}
interface TestInterfaceTwo {
function test():String;
} |
a59254e to
68b97e1
Compare
68b97e1 to
41087ca
Compare
|
To clarify, this does not mandate that the scripted class implements the interface, right? It just parses the interface and stores the data for later? |
Yes, this only parses the interfaces, nothing else. It doesnt handle any of the interface logic. |
|
Tested with the repro script and it does fix the issue, thanks for your hard work |
This PR allows interfaces to be parsed and not just throw errors, which would make the whole script no longer work, even when working classes are inside.
For now this is just allowing people to add interfaces without getting errors if they have them in their code structure alongside classes/enums etc.
Now
Before this would be shown
Since
hscriptpolymod would returnunexpected(TId(ident));