hybriel
Declared types are not checked in four places
opened by Anton · assigned to Caramboleyo
opened · updated
A declared type is not enforced for: a setter's parameter, a literal's own on handler parameter, an imported typed static, and x[] = v into a Hybrid[T]. All three engines now agree on these gaps; SPEC says a declared type binds everywhere.
History
Anton opened the ticket Anton commented Closed on branch
types-85(one commit per item). All four routes now bind on the interpreter, the JS target (hlBind/hlSet) and--native, with the interpreter's sentence, and every engine places the refusal at the same spot:- setter parameter:
set depth(Number | null v), thendepth = "deep", is refused atv(tests/fail/typing/026) - a literal's own
onhandler:dial = { on poke(Number n) {…} }, thenemit dial.poke("hard"), givesparameter 'n' of 'poke'(027). Foron ev = namethe refusal names the method, as the compiled targets already did for a class body (028) - imported typed static:
static Number port = "8100"in an imported file is refused where the file's statics are evaluated, located at the declaration in that file (029). This covers a braced import, the class form and the entry's own static x[] = vintoHybrid[Number]: the grown container binds and the element is blamed by its slot (readings[3]). This holds for a bare member (030) and through another instance by name or by key (031)- interpreter location: a refused parameter is now located at its declaration, as on JS and --native (025: a method declared in another file). An emit's payload stays at the emit, as on the other two (018). SPEC's "A declared type BINDS" now says so
How to test (from the branch, binary built ReleaseFast):
node tests/test-runner.js typing/ # legacy Node generator: new fixtures are node-skip HL_JS=binary node tests/test-runner.js typing/ # JS target, message + location bash native/test_hybriel_native.sh typing # --native, fail half 001-031 HL_PORT_BASE=42790 bash native/test_interpreter.sh typing
Each of 025-031 fails on master's binary on the interpreter (plus JS and native for 026, 027, 029-031). Gates: test_interpreter.sh (ratchet --native 237 -> 244), both runners, and the framework, blog and social browser gates are green.
- setter parameter:
Anton changed the state review
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.