diff options
author | Eduardo Julian | 2016-10-14 21:14:46 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-10-14 21:14:46 -0400 |
commit | dd37c28264888fec538161fc5cd2f2ca923938c8 (patch) | |
tree | 39943cef6920f54cb830d7b8157c4d158a9f64c6 | |
parent | 7b8ffed7964dd929e0877269b4870a695c4d173a (diff) | |
parent | b009b396ed92618974385575df7bbde87a4e2e96 (diff) |
Merge branch 'master' into inline_loop
-rw-r--r-- | src/lux/compiler/lux.clj | 16 | ||||
-rw-r--r-- | src/lux/type.clj | 4 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/lux/compiler/lux.clj b/src/lux/compiler/lux.clj index 72326447a..74c6221bb 100644 --- a/src/lux/compiler/lux.clj +++ b/src/lux/compiler/lux.clj @@ -35,21 +35,19 @@ :let [_ (.visitFieldInsn *writer* Opcodes/GETSTATIC "java/lang/Boolean" (if ?value "TRUE" "FALSE") "Ljava/lang/Boolean;")]] (return nil))) -(do-template [<name> <class> <sig> <caster>] +(do-template [<name> <class> <prim> <caster>] (defn <name> [value] (|do [^MethodVisitor *writer* &/get-writer :let [_ (doto *writer* - (.visitTypeInsn Opcodes/NEW <class>) - (.visitInsn Opcodes/DUP) (.visitLdcInsn (<caster> value)) - (.visitMethodInsn Opcodes/INVOKESPECIAL <class> "<init>" <sig>))]] + (.visitMethodInsn Opcodes/INVOKESTATIC <class> "valueOf" (str "(" <prim> ")" (&host-generics/->type-signature <class>))))]] (return nil))) - compile-nat "java/lang/Long" "(J)V" long - compile-int "java/lang/Long" "(J)V" long - compile-frac "java/lang/Long" "(J)V" long - compile-real "java/lang/Double" "(D)V" double - compile-char "java/lang/Character" "(C)V" char + compile-nat "java/lang/Long" "J" long + compile-int "java/lang/Long" "J" long + compile-frac "java/lang/Long" "J" long + compile-real "java/lang/Double" "D" double + compile-char "java/lang/Character" "C" char ) (defn compile-text [?value] diff --git a/src/lux/type.clj b/src/lux/type.clj index 05a353e85..87c330691 100644 --- a/src/lux/type.clj +++ b/src/lux/type.clj @@ -815,10 +815,10 @@ (return fixpoints) (check-error "" expected actual)) - [(&/$NamedT ?ename ?etype) _] + [(&/$NamedT _ ?etype) _] (check* class-loader fixpoints invariant?? ?etype actual) - [_ (&/$NamedT ?aname ?atype)] + [_ (&/$NamedT _ ?atype)] (check* class-loader fixpoints invariant?? expected ?atype) [_ _] |