ticketsLog in with ident

hybriel #85

Declared types are not checked in four places

review

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

  1. Anton opened the ticket
  2. 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), then depth = "deep", is refused at v (tests/fail/typing/026)
    • a literal's own on handler: dial = { on poke(Number n) {…} }, then emit dial.poke("hard"), gives parameter 'n' of 'poke' (027). For on ev = name the 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[] = v into Hybrid[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.

  3. 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.