Created
October 25, 2013 04:57
-
-
Save arohner/7149600 to your computer and use it in GitHub Desktop.
into-array>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(t/ann make-process [String -> java.lang.Process]) | |
(defn make-process [script] | |
(let [^Runtime r (Runtime/getRuntime) | |
arr (t/into-array> String ["echo 'hello'"])] | |
(t/print-env "let") | |
(.exec r arr))) |
The problem was reflection:
(cf (fn make-process [script]
{:post [%]}
(let [^Runtime r (Runtime/getRuntime)
_ (assert r)
^"[Ljava.lang.String;" arr (into-array> String ["echo 'hello'"])]
(.exec r arr)))
[String -> java.lang.Process])
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ExceptionInfo Internal Error (circle.scratch:14:5) Unresolved instance method invocation exec.
Hint: add type hints.
in: (.exec r arr) clojure.core/ex-info (core.clj:4327)