Provide equals/hashCode/toString for KType implementation
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
public class J {
|
||||
public static String foo() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import kotlin.test.assertNotEquals
|
||||
|
||||
fun nonNullString(): String = ""
|
||||
fun nullableString(): String? = ""
|
||||
|
||||
fun box(): String {
|
||||
assertNotEquals(J::foo.returnType, ::nonNullString.returnType)
|
||||
assertNotEquals(J::foo.returnType, ::nullableString.returnType)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.List;
|
||||
|
||||
public class J {
|
||||
public static String string() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<Object> list() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("kotlin.String!", J::string.returnType.toString())
|
||||
assertEquals("kotlin.(Mutable)List<kotlin.Any!>!", J::list.returnType.toString())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user