Partly support generics and nullable types as parameters for script templates
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
val v: Array<in String> = param[0]
|
||||
val s = v[0]
|
||||
|
||||
System.out.println("first: $s, size: ${v.size}")
|
||||
@@ -0,0 +1,4 @@
|
||||
val v1 = myArgs[0]
|
||||
val v2 = myArgs[1]
|
||||
|
||||
System.out.println("$v1 and $v2")
|
||||
@@ -0,0 +1,4 @@
|
||||
import java.lang.RuntimeException
|
||||
|
||||
val k: Int? = param
|
||||
if (k == null) System.out.println("Param is null") else throw RuntimeException("param is not null")
|
||||
@@ -0,0 +1,5 @@
|
||||
import java.lang.RuntimeException
|
||||
|
||||
val v: String? = param[0]
|
||||
|
||||
if (v == null) System.out.println("nullable") else RuntimeException("non nullable projection")
|
||||
@@ -0,0 +1,4 @@
|
||||
val v1 = param1[0].toString()
|
||||
val v2 = param2[0].toLong()
|
||||
|
||||
System.out.println("$v1 and $v2")
|
||||
Reference in New Issue
Block a user