diff options
author | Eduardo Julian | 2015-01-11 03:06:34 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-01-11 03:06:34 -0400 |
commit | 9e39423ab1eec0486e752bfdd06e34a64b6cfdd8 (patch) | |
tree | a3aa9873be0ac9143c7d8117b1195ca79cd1facf /src/lux/type.clj | |
parent | 409821d93f2781559677cdc2595ed15aa41eb933 (diff) |
- Added substraction, multiplication and division for ints.
Diffstat (limited to '')
-rw-r--r-- | src/lux/type.clj | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/lux/type.clj b/src/lux/type.clj index b29fcd5d1..854610de7 100644 --- a/src/lux/type.clj +++ b/src/lux/type.clj @@ -65,15 +65,20 @@ _ (update ?id =top actual)] success)])) - [[::primitive ?prim] _] - (let [as-obj (case ?prim - "boolean" [:lang.type/object "java.lang.Boolean" []] - "int" [:lang.type/object "java.lang.Integer" []] - "long" [:lang.type/object "java.lang.Long" []] - "char" [:lang.type/object "java.lang.Character" []] - "float" [:lang.type/object "java.lang.Float" []] - "double" [:lang.type/object "java.lang.Double" []])] - (solve as-obj actual)) + ;; [[::primitive ?prim] _] + ;; (let [as-obj (case ?prim + ;; "boolean" [:lang.type/object "java.lang.Boolean" []] + ;; "int" [:lang.type/object "java.lang.Integer" []] + ;; "long" [:lang.type/object "java.lang.Long" []] + ;; "char" [:lang.type/object "java.lang.Character" []] + ;; "float" [:lang.type/object "java.lang.Float" []] + ;; "double" [:lang.type/object "java.lang.Double" []])] + ;; (solve as-obj actual)) + + [[::primitive ?e-prim] [::primitive ?a-prim]] + (if (= ?e-prim ?a-prim) + success + (fail (str "Can't solve types: " (pr-str expected actual)))) [[::object ?eclass []] [::object ?aclass []]] (if (.isAssignableFrom (Class/forName ?eclass) (Class/forName ?aclass)) |