are `someList is List<*>` and `someList is L...
# getting-started
j
are
someList is List<*>
and
someList is List
equivalent? and what if it is not List but a random generic class?
y
The second is (rarely) allowed by the compiler. I believe it only works if
someList
is an
Iterable
. That's because if
someList
is
Iterable<T>
, then checking
is List
clearly means
is List<T>
and the generic is not "unchecked" because it was pre-known
j
okay, thanks
actually, it seems to work for normal custom classes as well: https://pl.kotl.in/dekStWRol
ah but not if we use some other variable or value in the test
it seems to work as long as the type is the same but only the generic parameter differs in type but if we use some other type itself, then it requires
<*>