robstoll
03/05/2019, 8:44 PMclass A<T>{}
fun <E> A<E>.foo(a: E){}
fun <E> A<E>.foo(b: Int){}
fun test(){
A<Int?>().foo(null)
}
Nikky
03/05/2019, 8:50 PMA<Int?>
the function `foo`'s generic is not knownNikky
03/05/2019, 8:51 PMrobstoll
03/05/2019, 8:52 PMnull
to Int?
for whatever reasonrobstoll
03/05/2019, 8:53 PMclass A<T>{}
fun <E: Any?> A<E>.foo(a: E){}
fun <E: Any> A<E>.foo(b: E){}
fun test2(){
A<Int?>().foo(null)
}
robstoll
03/05/2019, 8:53 PMNikky
03/05/2019, 8:53 PMNikky
03/05/2019, 8:53 PMrobstoll
03/05/2019, 8:54 PMDominaezzz
03/05/2019, 8:54 PMDominaezzz
03/05/2019, 8:55 PMrobstoll
03/05/2019, 8:56 PMrobstoll
03/05/2019, 8:57 PMpublic class AExtension {
public static <E> void foo(E e){}
public static void foo(Integer e){}
}
Dominaezzz
03/05/2019, 8:57 PMint
?robstoll
03/05/2019, 8:58 PMrobstoll
03/05/2019, 8:58 PMDominaezzz
03/05/2019, 8:59 PMrobstoll
03/05/2019, 9:00 PMInt
with String
the problem remainsrobstoll
03/05/2019, 9:01 PMrobstoll
03/05/2019, 9:01 PMDominaezzz
03/05/2019, 9:03 PMrobstoll
03/05/2019, 9:03 PMrobstoll
03/05/2019, 9:04 PMDominaezzz
03/05/2019, 9:04 PMrobstoll
03/05/2019, 9:06 PMShouldn't that beThat was correct 😉?int