Open Jamesernator opened 7 years ago
I just ran into a potentially similar problem with new
:
let f = x => new C(x)
throws an error but
let f = x => { return new C(x); }
does not. Might be unrelated but I suspect it has something to do with how we parse new
.
Using the latest version (3.0.10) this results in an error:
Error message
Error: Unknown object: {"value":{"token":{"typeCode":3,"type":{"klass":{"name":"Numeric"},"name":""},"value":3,"slice":{"text":"3","start":397,"startLocation":{"line":20,"column":21,"filename":"","position":397},"end":398},"octal":false,"noctal":false},"bindings":{"_map":{}},"scopesets":{"all":[{"name":"outsideEdge_1"}],"phase":{"0":[{"name":"insideEdge0_2"}]}}},"type":"RawSyntax","loc":null}I'm not sure what the minimal cause of the bug is, but I did find that if I do:
Then it's happy.
So it's probably some interaction between operator overloading and new.