Two general fixes shaken out by core.typed's runtime contract suite
Running clojure.core.typed's runtime contract tests (typed/runtime.jvm, test_contract — 5/5 pass) surfaced two general jolt gaps, both runtime, both JVM-certified: - instance? Object / java.lang.Object returned false for everything. Object is the root of the type hierarchy: every non-nil value is an instance of Object, nil is not. core.typed's (instance-c Object) contract depends on this; many libraries do. - @Compiler/LINE and @Compiler/COLUMN (clojure.lang.Compiler statics — Vars on the JVM holding the line/column of the form being compiled) were unresolved. Macros read @Compiler/LINE as a fallback when &form carries no position. Now backed by derefable cells updated per top-level form, like *current-source*. The core.typed type checker itself (tools.analyzer.jvm + ASM bytecode + clojure.lang.Compiler internals) and the cljs runtime are not portable, so the checker/check-ns surface is out of scope; this is the runtime contract layer. make test green (+4 corpus rows, 0 new divergences), shakesmoke byte-identical.
This commit is contained in:
parent
9805620997
commit
720734a481
3 changed files with 29 additions and 1 deletions
|
|
@ -3353,4 +3353,8 @@
|
|||
{:suite "clojure.core / range" :label "(range 5 5) is the empty seq ()" :expected "true" :actual "(= () (range 5 5))"}
|
||||
{:suite "clojure.core / range" :label "empty range is not nil" :expected "true" :actual "(some? (range 5 0))"}
|
||||
{:suite "clojure.core / range" :label "empty range count" :expected "0" :actual "(count (range 0))"}
|
||||
{:suite "host-interop / instance? Object" :label "every non-nil value is an Object" :expected "[true true true true]" :actual "[(instance? Object 1) (instance? Object \"x\") (instance? Object []) (instance? Object (fn []))]"}
|
||||
{:suite "host-interop / instance? Object" :label "nil is not an instance of Object" :expected "false" :actual "(instance? Object nil)"}
|
||||
{:suite "host-interop / instance? Object" :label "java.lang.Object too" :expected "true" :actual "(instance? java.lang.Object :k)"}
|
||||
{:suite "host-interop / Compiler" :label "@Compiler/LINE is a number" :expected "true" :actual "(number? @clojure.lang.Compiler/LINE)"}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue