aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2015-12-24 19:00:49 -0400
committerEduardo Julian2015-12-24 19:00:49 -0400
commit7e9db69d78ae4abbad922e093361fc2632518008 (patch)
tree05d1c125b7e4154cf186d1023fd83cf0dc76c863
parent3bf965410b7a18eabb6164ef2efae3718ba3f222 (diff)
- Fixed a bug wherein the wrong super-class name was being generated (due to a type error >_<) when generating the default constructor for anonymous classes.
- Fixed a bug when tracing the lineage of interfaces when doing host-type type-checking.
-rw-r--r--src/lux/compiler/host.clj5
-rw-r--r--src/lux/type/host.clj3
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lux/compiler/host.clj b/src/lux/compiler/host.clj
index ceec03870..3c937b2af 100644
--- a/src/lux/compiler/host.clj
+++ b/src/lux/compiler/host.clj
@@ -597,7 +597,8 @@
<init>-return))
(defn ^:private add-anon-class-<init> [^ClassWriter class-writer compile class-name super-class env ctor-args]
- (let [init-types (->> ctor-args (&/|map (comp &host-generics/->type-signature &/|first)) (&/fold str ""))]
+ (|let [[super-class-name super-class-params] super-class
+ init-types (->> ctor-args (&/|map (comp &host-generics/->type-signature &/|first)) (&/fold str ""))]
(&/with-writer (.visitMethod class-writer Opcodes/ACC_PUBLIC init-method (anon-class-<init>-signature env) nil nil)
(|do [^MethodVisitor =method &/get-writer
:let [_ (doto =method (.visitCode)
@@ -609,7 +610,7 @@
(return nil))))
ctor-args)
:let [_ (doto =method
- (.visitMethodInsn Opcodes/INVOKESPECIAL (&host-generics/->bytecode-class-name super-class) init-method (str "(" init-types ")" <init>-return))
+ (.visitMethodInsn Opcodes/INVOKESPECIAL (&host-generics/->bytecode-class-name super-class-name) init-method (str "(" init-types ")" <init>-return))
(-> (doto (.visitVarInsn Opcodes/ALOAD 0)
(.visitVarInsn Opcodes/ALOAD (inc ?captured-id))
(.visitFieldInsn Opcodes/PUTFIELD class-name captured-name clo-field-sig))
diff --git a/src/lux/type/host.clj b/src/lux/type/host.clj
index ac045eebe..5f19904d3 100644
--- a/src/lux/type/host.clj
+++ b/src/lux/type/host.clj
@@ -31,8 +31,7 @@
(.getInterfaces sub-class))]
(if (= super-class super-interface)
(&/Cons$ super-interface stack)
- (let [super* (.getSuperclass sub-class)]
- (recur super* (&/Cons$ super* stack)))))))
+ (recur super-interface (&/Cons$ super-interface stack))))))
(.isInterface super-class)
(let [class<=interface? #(if (= super-class %) % nil)]