kirillrakhman
10/04/2017, 7:56 AMclass Foo: (key: String) -> String
gives an error "Unsupported: named parameter in function type in supertype position", but
typealias KeyFunction = (key: String) -> String
class Foo: KeyFunction
actually works.
The benefit is that when you let IDEA generate the missing members, the parameter name is set to key
instead p1
elect
10/04/2017, 9:36 AMkirillrakhman
10/04/2017, 12:06 PMelect
10/04/2017, 1:05 PMkirillrakhman
10/04/2017, 1:52 PMtypealias Provider = (Foo) -> Bar
. But in other cases, the implementation is more complex and has dependencies, so you implement it using a standalone type class MyProvider: Provider