// This errors:
type foo = {open: false};
// another:
bla.open;
In general, it'd be great if record/obj keys have "higher priority" than build-in keywords? Is that a good idea? If not, at least better errors.
I think this is doable even if a bit tricky. You have to create a new parse rule for identifiers suitable for use in places such as keys/record labels. Those identifiers would be the union of typical identifiers, and other tokens. We'd then just need to make sure that the compiler itself doesn't complain when handed an AST with record labels matching certain tokens - and if so, we'd have to do some escaping.
I think that's probably not a great idea? keywords should be keywords.
but let's ditch open from the default reason syntax :D (we can just have it be import * from SomeMod)
Yeah, maybe by trimming out the keywords, we can achieve the same effect.
might be useful for external JS objects too. it's not uncommon to have "type" as a property name, and jsObj##type throws, forcing to create a FFI
Same as https://github.com/facebook/reason/issues/824#issuecomment-338384372 :
Besides that, it could be implemented.
Yeah then let's not for now. We'll have better errors for these soon
Most helpful comment
might be useful for external JS objects too. it's not uncommon to have
"type"as a property name, andjsObj##typethrows, forcing to create a FFI