Fix tests: "Placing function type parameters after the function name" error
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
fun foo<T: Number?>(t: T) {
|
||||
fun <T: Number?> foo(t: T) {
|
||||
(t ?: 42).toInt()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
fun foo<T : Number?>(t: T) {
|
||||
fun <T : Number?> foo(t: T) {
|
||||
t?.toInt()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun isNull(x: Unit?) = x == null
|
||||
|
||||
fun isNullGeneric<T : Any>(x: T?) = x == null
|
||||
fun <T : Any> isNullGeneric(x: T?) = x == null
|
||||
|
||||
fun deepIsNull0(x: Unit?) = isNull(x)
|
||||
fun deepIsNull(x: Unit?) = deepIsNull0(x)
|
||||
|
||||
@@ -23,7 +23,7 @@ abstract class Tag(val name: String) : Element() {
|
||||
val children = ArrayList<Element>()
|
||||
val attributes = HashMap<String, String>()
|
||||
|
||||
inline protected fun initTag<T : Element>(tag: T, init: T.() -> Unit): T {
|
||||
inline protected fun <T : Element> initTag(tag: T, init: T.() -> Unit): T {
|
||||
tag.init()
|
||||
children.add(tag)
|
||||
return tag
|
||||
@@ -47,7 +47,7 @@ abstract class Tag(val name: String) : Element() {
|
||||
}
|
||||
|
||||
abstract class TagWithText(name: String) : Tag(name) {
|
||||
fun String.plus() {
|
||||
operator fun String.unaryPlus() {
|
||||
children.add(TextElement(this))
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ abstract class Tag(val name: String) : Element() {
|
||||
val children = ArrayList<Element>()
|
||||
val attributes = HashMap<String, String>()
|
||||
|
||||
inline protected fun initTag<T : Element>(tag: T, init: T.() -> Unit): T {
|
||||
inline protected fun <T : Element> initTag(tag: T, init: T.() -> Unit): T {
|
||||
tag.init()
|
||||
children.add(tag)
|
||||
return tag
|
||||
@@ -47,7 +47,7 @@ abstract class Tag(val name: String) : Element() {
|
||||
}
|
||||
|
||||
abstract class TagWithText(name: String) : Tag(name) {
|
||||
fun String.plus() {
|
||||
operator fun String.unaryPlus() {
|
||||
children.add(TextElement(this))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
inline fun test<reified T>(x: Any): Boolean {
|
||||
inline fun <reified T> test(x: Any): Boolean {
|
||||
val x = object {
|
||||
val y = x is T
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
inline fun f<reified T>(x : () -> Unit) {
|
||||
inline fun <reified T> f(x : () -> Unit) {
|
||||
object { init { arrayOf<T>() } }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ fun <T> test2(): T {
|
||||
return a as T
|
||||
}
|
||||
|
||||
fun test3<T: Any>() = null as T
|
||||
fun <T: Any> test3() = null as T
|
||||
|
||||
fun box(): String {
|
||||
if (test1<Int?>() != null) return "fail: test1"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
inline fun calc<T, R>(value : T, fn: (T)->R) : R = fn(value)
|
||||
inline fun <T, R> calc(value : T, fn: (T) -> R) : R = fn(value)
|
||||
inline fun <T> identity(value : T) : T = calc(value) {
|
||||
if (1 == 1) return it
|
||||
it
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
fun foo<T : Any>(t: T) = t
|
||||
fun <T : Any> foo(t: T) = t
|
||||
|
||||
Reference in New Issue
Block a user