Join Slack
Powered by
Is there a way to define a generic function only f...
# announcements
h
hagabaka
11/09/2017, 4:53 PM
Is there a way to define a generic function only for T which defines …`T.minus(T) -> T`?
k
kirillrakhman
11/09/2017, 4:54 PM
you might find
http://beust.com/weblog/2016/06/20/ad-hoc-polymorphism-in-kotlin/
interesting
kirillrakhman
11/09/2017, 4:54 PM
also
https://github.com/Kotlin/KEEP/pull/87
h
hagabaka
11/09/2017, 5:09 PM
thanks...I guess it's not possible for now
hagabaka
11/09/2017, 5:10 PM
is it possible to write specify that a parameter can be one of a few given types?
a
Andreas Sinz
11/09/2017, 5:12 PM
@hagabaka
nope, there are no sum types in kotlin
h
hagabaka
11/09/2017, 5:13 PM
ok
2
Views
Open in Slack
Previous
Next