core.contracts: fully passes, two general fixes
clojure.core.contracts (over core.unify) now runs its whole suite on jolt — 14/14 across contracts/constraints/with-constraints/provide tests. Two general gaps fixed: - Symbol and Keyword now report IFn (and Fn/Runnable/Callable) in the modeled class hierarchy, so a (class x)-dispatched multimethod with an IFn method matches a symbol or keyword, like the JVM (both implement IFn — they're callable). core.contracts' funcify* dispatches on (class constraint) and a bare predicate symbol must hit the IFn arm. Runtime, no re-mint. - A live Var value spliced into a form by a macro (defcurry-from resolves a var and emits (~v l r)) now compiles: analyze treats a var-cell form as a :the-var reference by ns+name, the same node as (var ns/name), mirroring the existing spliced-namespace (~*ns*) case. analyzer.clj + host-contract.ss, re-mint (prelude stays byte-identical; only the analyzer image changes). Listed in docs/libraries.md + the site. make test green (+2 corpus rows, 0 new divergences), shakesmoke byte-identical.
This commit is contained in:
parent
2c5b7dd918
commit
a83ff6ce40
6 changed files with 27 additions and 3 deletions
|
|
@ -3365,4 +3365,6 @@
|
|||
{:suite "symbols / construction" :label "(symbol nil name) equals (symbol name)" :expected "true" :actual "(= (symbol nil \"foo\") (quote foo))"}
|
||||
{:suite "symbols / construction" :label "(symbol nil name) has no namespace" :expected "true" :actual "(nil? (namespace (symbol nil \"x\")))"}
|
||||
{:suite "host-interop / instance? hierarchy" :label "ExceptionInfo is a RuntimeException" :expected "[true true true]" :actual "[(instance? RuntimeException (ex-info \"x\" {})) (instance? Exception (ex-info \"x\" {})) (instance? Throwable (ex-info \"x\" {}))]"}
|
||||
{:suite "host-interop / class hierarchy" :label "Symbol and Keyword are IFn" :expected "[true true]" :actual "[(isa? clojure.lang.Symbol clojure.lang.IFn) (isa? clojure.lang.Keyword clojure.lang.IFn)]"}
|
||||
{:suite "host-interop / class hierarchy" :label "(class sym)-dispatched multimethod hits an IFn method" :expected ":ifn" :actual "(do (defmulti cm1 class) (defmethod cm1 clojure.lang.IFn [_] :ifn) (cm1 (quote sym)))"}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue