From 4049370ec0d0bec578b8fcb83700d020e81386c4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 17 Sep 2019 00:27:13 -0400 Subject: Fixed some bugs related to JVM types. --- stdlib/source/lux/data/text/format.lux | 7 +------ stdlib/source/lux/target/jvm/loader.lux | 2 +- stdlib/source/lux/target/jvm/type/alias.lux | 9 +++++---- stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux | 4 ++-- stdlib/source/test/lux/target/jvm.lux | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) (limited to 'stdlib/source') diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux index 99dbc2a73..9f47c4292 100644 --- a/stdlib/source/lux/data/text/format.lux +++ b/stdlib/source/lux/data/text/format.lux @@ -63,14 +63,9 @@ [instant instant.Instant instant.to-text] [duration duration.Duration duration.encode] [date date.Date (:: date.codec encode)] + [cursor Cursor .cursor-description] ) -(def: #export (cursor [file line column]) - (Format Cursor) - (|> (.list (..text file) (..nat line) (..nat column)) - (text.join-with ", ") - (text.enclose ["[" "]"]))) - (def: #export (mod modular) (All [m] (Format (modular.Mod m))) (let [[_ modulus] (modular.un-mod modular)] diff --git a/stdlib/source/lux/target/jvm/loader.lux b/stdlib/source/lux/target/jvm/loader.lux index ed82231e1..3e17d42c8 100644 --- a/stdlib/source/lux/target/jvm/loader.lux +++ b/stdlib/source/lux/target/jvm/loader.lux @@ -45,7 +45,7 @@ (invoke [java/lang/Object [java/lang/Object]] #try java/lang/Object)) (import: #long (java/lang/Class a) - (getDeclaredMethod [java/lang/String [(java/lang/Class java/lang/Object)]] java/lang/reflect/Method)) + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) (import: #long java/lang/Integer (#static TYPE (java/lang/Class java/lang/Integer))) diff --git a/stdlib/source/lux/target/jvm/type/alias.lux b/stdlib/source/lux/target/jvm/type/alias.lux index 9d92d7b6a..cd631a251 100644 --- a/stdlib/source/lux/target/jvm/type/alias.lux +++ b/stdlib/source/lux/target/jvm/type/alias.lux @@ -53,13 +53,14 @@ (<>.after (.this //descriptor.class-prefix)) (<>.before (.this //descriptor.class-suffix)))) -(template [ ] +(template [ ] [(def: (-> (Parser (Type Class)) (Parser (Type Parameter))) - (<>.after (.this )))] + (|>> (<>.after (.this )) + (:: <>.monad map )))] - [lower //signature.lower-prefix ..Lower] - [upper //signature.upper-prefix ..Upper] + [lower //signature.lower-prefix //.lower ..Lower] + [upper //signature.upper-prefix //.upper ..Upper] ) (def: (parameter aliasing) diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux b/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux index 2d1dec4b2..63f0561c0 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux +++ b/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux @@ -1128,7 +1128,7 @@ [inputsT (|> (java/lang/reflect/Method::getGenericParameterTypes method) array.to-list (monad.map @ (|>> reflection!.type ////.lift)) - (////@map (monad.map @ (reflection-type mapping))) + (////@map (monad.map @ (..reflection-type mapping))) ////@join) outputT (|> method java/lang/reflect/Method::getGenericReturnType @@ -1139,7 +1139,7 @@ exceptionsT (|> (java/lang/reflect/Method::getGenericExceptionTypes method) array.to-list (monad.map @ (|>> reflection!.type ////.lift)) - (////@map (monad.map @ (reflection-type mapping))) + (////@map (monad.map @ (..reflection-type mapping))) ////@join) #let [methodT (<| (type.univ-q (dictionary.size mapping)) (type.function (case method-style diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index fc7c140b4..5ffe668fc 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -67,7 +67,7 @@ (invoke [java/lang/Object [java/lang/Object]] #try java/lang/Object)) (import: #long (java/lang/Class c) - (getDeclaredMethod [java/lang/String [(java/lang/Class java/lang/Object)]] java/lang/reflect/Method)) + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) (import: #long java/lang/Object (getClass [] (java/lang/Class java/lang/Object)) -- cgit v1.2.3