edwardwongtl
10/18/2017, 8:48 AMt
is Iterable
inside your concat
, and skip the listOf(t)
is truekarelpeeters
10/18/2017, 9:14 AMnil2l
10/18/2017, 9:31 AMkarelpeeters
10/18/2017, 9:49 AMnil2l
10/18/2017, 11:00 AMkarelpeeters
10/18/2017, 11:00 AM+
is defined to combine two lists by the stdlib, so basically you're breaking it.nil2l
10/18/2017, 11:02 AM1 + listOf(2)
you receive undefined
. So what does it break?karelpeeters
10/18/2017, 11:03 AMlistOf(1) + listOf(2)
as well.nil2l
10/18/2017, 11:04 AMnil2l
10/18/2017, 11:06 AMInt
instead of generic T
it won’t break concat of two lists, it will say type error. And it’s correct.edwardwongtl
10/18/2017, 11:07 AMT
is just a over generalised type, if you don't give any bound to it, it can be anythingkarelpeeters
10/18/2017, 11:07 AMT = Any
and then they both match.edwardwongtl
10/18/2017, 11:08 AMT
more specific to the type your want to affectnil2l
10/18/2017, 11:08 AMList< T> != T
?edwardwongtl
10/18/2017, 11:09 AMT: List<*>
?karelpeeters
10/18/2017, 11:09 AMnil2l
10/18/2017, 11:12 AMnil2l
10/18/2017, 11:12 AMkarelpeeters
10/18/2017, 11:28 AM