File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 161161
162162#?(:clj
163163 (defn resolve-type-hint [ctx sym]
164- (or (get prim->class sym)
165- (:class (resolve-class-opts ctx sym)))))
164+ (if (string? sym) (Class/forName sym)
165+ (or (get prim->class sym)
166+ (:class (resolve-class-opts ctx sym))))))
166167
167168#?(:clj
168169 (def ->array-class
Original file line number Diff line number Diff line change 334334 (is (= 1 (tu/eval* " (let [j #js {:a (fn [] 1)}] (j.a))" nil )))))
335335
336336(deftest type-hint-test
337+ (testing " string type hints"
338+ (is (string? (sci/eval-string " (defn read-string [^\" [B\" v] (String. v)) (read-string \" 1\" )" ))))
337339 (testing " type hinting with runnable returns nil on futuretask get"
338340 #?(:clj
339341 (let [config {:classes {'java.util.concurrent.Executors java.util.concurrent.Executors 'java.util.concurrent.ThreadPoolExecutor java.util.concurrent.ThreadPoolExecutor 'java.util.concurrent.Callable java.util.concurrent.Callable 'java.util.concurrent.FutureTask java.util.concurrent.FutureTask 'java.lang.Runnable java.lang.Runnable}}]
You can’t perform that action at this time.
0 commit comments