Reject unit arguments of @set, @set_index and @get_index externals
Why
A unit argument is left out of the JS code, so the compiler crashed with an assertion failure when it built the property access without its object, index or value (#9339). @get already rejected it.
addedDiagnostic unit argument of a property external
type t@set external setX: (t, unit) => unit = "x"
diagnostic
Before
After
Fatal error: exception File "compiler/core/lam_compile_external_call.ml", line 448, characters 11-17: Assertion failedIll defined attribute @set (unit argument is not allowed)
Fixes #9339
Review
- Can such an external be useful? No. It would set or read a property with a part missing. Declaring one now fails even when it is never called; before, only a call crashed.