oday
07/06/2021, 9:04 AMinterface Stack<T : Any>
and
interface Stack<T>
?
T
already means literally anythingMatteo Mirk
07/06/2021, 9:08 AMT : Any?
so includes nullable types. Your first declaration excludes nullable types from the domain.oday
07/06/2021, 9:10 AMT
, feeding that T
back to Stack<T> will complainMatteo Mirk
07/06/2021, 9:20 AModay
07/06/2021, 9:20 AMMatteo Mirk
07/06/2021, 9:23 AMStack<Int?>
if you used the first definition, right?oday
07/06/2021, 9:25 AM