Skip to content

Commit e21a1c9

Browse files
committed
(WIP) Add read conditionalization for clj.runtime - more, more
1 parent ef3240f commit e21a1c9

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

typed/clj.runtime/deps-clr.edn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{:paths ["src" "resources"] }
1+
{:paths ["src" "resources"]
2+
:deps {local/typed.cljc.analyzer {:local/root "../cljc.analyzer"}}
3+
}

typed/clj.runtime/src/clojure/core/typed/expand.clj renamed to typed/clj.runtime/src/clojure/core/typed/expand.cljc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
~(expand-with-open (subvec bindings 2) body)
260260
(finally
261261
(. ~(bindings 0) close))))
262-
:else (throw (IllegalArgumentException. "with-open only allows Symbols in bindings"))))]
262+
:else (throw (#?(:cljr ArgumentException. :default IllegalArgumentException.) "with-open only allows Symbols in bindings"))))]
263263
(expand-with-open bindings body)))
264264

265265
(defmethod -expand-macro 'clojure.core/assert
@@ -286,7 +286,7 @@
286286
(if (seq? (first sigs))
287287
sigs
288288
;; Assume single arity syntax
289-
(throw (IllegalArgumentException.
289+
(throw (#?(:cljr ArgumentException. :default IllegalArgumentException.)
290290
(if (seq sigs)
291291
(str "Parameter declaration "
292292
(first sigs)

typed/clj.runtime/src/typed/cljc/runtime/env_utils_annotations.clj renamed to typed/clj.runtime/src/typed/cljc/runtime/env_utils_annotations.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(ns ^:no-doc typed.cljc.runtime.env-utils-annotations
1010
(:require [typed.clojure :as t]
1111
[typed.cljc.runtime.env-utils :as env-utils])
12-
(:import [java.lang.ref SoftReference]))
12+
(:import #?(:clojure [java.lang.ref SoftReference])))
1313

1414
(t/defalias env-utils/InvalidationId t/Str)
1515
(t/defalias env-utils/ForcedType

typed/clj.runtime/src/typed/clojure/jvm.clj renamed to typed/clj.runtime/src/typed/clojure/jvm.cljc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
(apply hash-map args))
4242
this-ns (ns-name *ns*)]
4343
`(clojure.core.typed/tc-ignore
44-
(let [nme# (or (when-some [^Class c# (ns-resolve '~this-ns '~nme)]
44+
(let [nme# (or (when-some [^#?(:cljr Type :default Class) c# (ns-resolve '~this-ns '~nme)]
4545
(when (class? c#)
46-
(-> c# .getName symbol)))
46+
(-> c# #?(:cljr .FullName :default .getName) symbol)))
4747
(throw (ex-info (str "Could not resolve class: " '~nme) {:class-name '~nme})))]
4848
;; TODO runtime env
4949
#_

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy