https://kotlinlang.org logo
#getting-started
Title
# getting-started
m

martmists

10/13/2022, 4:20 PM
IntelliJ resolves the functions just fine, so why is gradle giving this error?
e

ephemient

10/13/2022, 4:36 PM
x is Float
does not imply
Float : T
, which would be required for that
return
.
l

Loney Chou

10/14/2022, 2:06 AM
This is counterintuitive. T is inferred as Float and Float is Number, but compiler just says excuse me I need T why you give me Float? I mean for non-final classes it's true, but for primitives and final classes, it's weird.
you can just cast these valid branches to T