From 8188ca2f93491aa7da983f9ee455c2e15f47b756 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 28 Nov 2015 22:08:27 -0400 Subject: - Improved support for existential quantification. --- src/lux/compiler/host.clj | 3 +++ src/lux/host.clj | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lux/compiler/host.clj b/src/lux/compiler/host.clj index f06852ae9..dab50107f 100644 --- a/src/lux/compiler/host.clj +++ b/src/lux/compiler/host.clj @@ -84,6 +84,9 @@ (&/$NamedT ?name ?type) (prepare-return! *writer* ?type) + (&/$ExT _) + nil + _ (assert false (str 'prepare-return! " " (&type/show-type *type*)))) *writer*)) diff --git a/src/lux/host.clj b/src/lux/host.clj index 310024700..2e251013a 100644 --- a/src/lux/host.clj +++ b/src/lux/host.clj @@ -67,7 +67,8 @@ _ (&/T 0 type))) -(let [object-array (str "[" "L" (->class "java.lang.Object") ";")] +(let [ex-type-class (str "L" (->class "java.lang.Object") ";") + object-array (str "[" "L" (->class "java.lang.Object") ";")] (defn ->java-sig [^objects type] "(-> Type (Lux Text))" (|case type @@ -103,6 +104,9 @@ (|do [type* (&type/apply-type ?F ?A)] (->java-sig type*)) + (&/$ExT _) + (return ex-type-class) + _ (assert false (str '->java-sig " " (&type/show-type type))) ))) @@ -122,7 +126,7 @@ lookup-field false ) -(do-template [ ] +(do-template [ ] (defn [class-loader target method-name args] (|let [target-class (Class/forName (&host-type/as-obj target) true class-loader)] (if-let [^Method method (first (for [^Method =method (.getDeclaredMethods (Class/forName (&host-type/as-obj target) true class-loader)) @@ -143,10 +147,10 @@ parent-gvars gvars gargs))) - (fail (str "[Host Error] Method does not exist: " target "." method-name))))) + (fail (str "[Host Error] " " method does not exist: " target "." method-name))))) - lookup-static-method true - lookup-virtual-method false + lookup-static-method true "Static" + lookup-virtual-method false "Virtual" ) (defn lookup-constructor [class-loader target args] -- cgit v1.2.3