diff truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java @ 22279:0fc995134ff3

asJavaObject can work with null value
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Tue, 06 Oct 2015 13:27:47 +0200
parents 85a6db6624ab
children 33d49924a921
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Tue Oct 06 13:08:12 2015 +0200
+++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Tue Oct 06 13:27:47 2015 +0200
@@ -247,6 +247,15 @@
     }
 
     @Test
+    public void testNullCanBeCastToAnything() throws Exception {
+        PolyglotEngine.Value retNull = findGlobalSymbol(returnsNull());
+
+        Object res = retNull.invoke(null).as(CompoundObject.class);
+
+        assertNull("Should yield real Java null", res);
+    }
+
+    @Test
     public void testNullInCompoundObject() throws Exception {
         CompoundObject obj = findCompoundSymbol();
         if (obj == null) {