lhwdev
10/04/2021, 5:00 AMfun <T> test(value: T): T {
value as Int
return 123
}
Shouldn't this work?lhwdev
10/04/2021, 5:02 AMvalue
is smartcast into Int
, but T
is not.
The error on 123
says The integer literal does not conform to the expected type T
.Albert Chang
10/04/2021, 5:03 AMlhwdev
10/04/2021, 5:05 AM