Partly support generics and nullable types as parameters for script templates

This commit is contained in:
Mikhail Zarechenskiy
2016-09-05 19:02:11 +03:00
parent 7230965e62
commit 3ad451e33e
8 changed files with 111 additions and 6 deletions
+4
View File
@@ -0,0 +1,4 @@
val v: Array<in String> = param[0]
val s = v[0]
System.out.println("first: $s, size: ${v.size}")
+4
View File
@@ -0,0 +1,4 @@
val v1 = myArgs[0]
val v2 = myArgs[1]
System.out.println("$v1 and $v2")
+4
View File
@@ -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")
+5
View File
@@ -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")
+4
View File
@@ -0,0 +1,4 @@
val v1 = param1[0].toString()
val v2 = param2[0].toLong()
System.out.println("$v1 and $v2")