IR Scripting: allow to specify nullable types for provided props...
but only explicitly. This does not fix a breaking change described in #KT-52120, because it seems the correct behavior, but it allows to "workaround" the problem by specifying nullability explicitly. Also improve handling of nullable bindings in JSR-223. #KT-49173 fixed #KT-51213 fixed
This commit is contained in:
+8
@@ -261,6 +261,10 @@ obj
|
||||
put("boundValue", 100)
|
||||
})
|
||||
Assert.assertEquals(111, result2)
|
||||
|
||||
engine.put("nullable", null)
|
||||
val result3 = engine.eval("bindings[\"nullable\"]?.let { it as Int } ?: -1")
|
||||
Assert.assertEquals(-1, result3)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -280,6 +284,10 @@ obj
|
||||
put("boundValue", 100)
|
||||
})
|
||||
Assert.assertEquals(111, result2)
|
||||
|
||||
engine.put("nullable", null)
|
||||
val result3 = engine.eval("nullable?.let { it as Int } ?: -1")
|
||||
Assert.assertEquals(-1, result3)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user