halgari/mjolnir — pull request #12 by kylewlacy (2014-07-03 01:06:01+00:00)
Title: Fix int-to-int type conversion

Take the following (contrived) example of a type cast:

```clj
(c/cast Int64 (c/+ (c/const 1 -> Int32) (c/const 2 -> Int32)))
```

This code exemplifies an issue where trying to cast from any one int type to another would cause the following stack trace to show up:

```
Remaining nodes...
#{["thing"] ["identity"] ["my-rand"] ["main"] ["rand"] ["my-fn"] ["user/-main"]}
[:inst.type/cast :inst.cast/type :type/int :type/int :inst.type/binop nil "rand" {:fn/name "rand", :db/id 17592186045427}]
Exception in thread "main" java.lang.AssertionError: Assert failed: inference fails
false
at mjolnir.inference$infer_all.invoke(inference.clj:100)
at mjolnir.core$to_llvm_module.invoke(core.clj:31)
...
```

This was due to a typo in `ssa_rules.clj`, where the (non-existent) field `:type/length` was erroneously used instead of the proper `:type/width` for comparing int sizes