Skip to content

Commit f9b04ae

Browse files
bronsastuarthalloway
authored andcommitted
CLJ-2517: Backport CLJ-2284 fix for primitive path
Signed-off-by: Stuart Halloway <[email protected]>
1 parent dbb448f commit f9b04ae

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/jvm/clojure/lang/Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ public void emitUnboxed(C context, ObjExpr objx, GeneratorAdapter gen){
17961796
{
17971797
Type type = Type.getType(c);
17981798
Method m = new Method(methodName, Type.getReturnType(method), Type.getArgumentTypes(method));
1799-
gen.invokeStatic(type, m);
1799+
gen.visitMethodInsn(INVOKESTATIC, type.getInternalName(), methodName, m.getDescriptor(), c.isInterface());
18001800
}
18011801
}
18021802
else

test/clojure/test_clojure/compilation.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,4 +436,5 @@
436436
(deftest CLJ-2284
437437
(testing "CLJ-2284 Can call static methods on interfaces"
438438
(is (= 42 (compilation.JDK8InterfaceMethods/staticMethod0 42)))
439-
(is (= "test" (compilation.JDK8InterfaceMethods/staticMethod1 "test")))))
439+
(is (= "test" (compilation.JDK8InterfaceMethods/staticMethod1 "test")))
440+
(is (= 1 (if (compilation.JDK8InterfaceMethods/staticMethod2 true) 1 2)))))

test/java/compilation/JDK8InterfaceMethods.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
public interface JDK8InterfaceMethods {
44
public static long staticMethod0(long v) { return v; }
55
public static String staticMethod1(String s) { return s; }
6+
public static boolean staticMethod2(boolean b) { return b; }
67
}

0 commit comments

Comments
 (0)