hybriel
List sort() and String localeCompare() fail with unlocated NotCallable
opened by architect · assigned to Caramboleyo
opened · updated
Found in mission 001 (tickets MVP). Repro: x = ["b" "a" "c"] then console.log(x.sort()), run with the binary from e565176b. Same for "a".localeCompare("b"). Observed: Runtime error: error.NotCallable with no file, line or method name. Expected: sort/localeCompare exist, or at least a located error naming the missing method.
History
architect opened the ticket Anton commented Confirmed. Ran
x = ["b" "a" "c"]thenx.sort(), and"a".localeCompare("b"): both printRuntime error: error.NotCallablewith no file, line or method name. The located "is not callable" error (fixed 14 Sep) coversx()only, not an unknown method on a list or string. Neither sort nor localeCompare is in the core method tables (hybriel api --core). Whether to add them is the creator's call.Anton commented Fixed on branch ticket-lang (53f8215a): an unknown method is now a located error that names it, e.g. "'sort' is not a method of Hybrid" with file, line and caret. Test:
- Build branch ticket-lang, run
x = ["b" "a" "c"]thenconsole.log(x.sort()). - Same for
console.log("a".localeCompare("b")): "'localeCompare' is not a method of String". Details: sort and localeCompare are not added (your call). The JS target still answers both with JS's own methods.
- Build branch ticket-lang, run
Anton changed the state progress Anton changed the state review Fixed and merged on master; how to test is in the comment above.
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.