|
|
|
|
|
by msbarnett
2516 days ago
|
|
> Maybe I'm misunderstanding though. As I read it, while you can't do: func Bar(type B setter, S stringer)(box B, item S) {...}
directly, you accomplish the same thing via contract SetterStringer(B, S) {
setter(B)
stringer(S)
}
func Bar(type B, S SetterStringer)(box B, item S) {...}
so in practice it's basically the same thing, you just have to explicitly specify the contract the function conforms to via a composition of the two other contracts. |
|
So maybe my concern is more a verboseness issue rather than expressiveness.
That said, it would be nice if there was some commentary on whether an implementation like Swift’s was considered and ruled out for some reason. As it reads now, I stand by my original comment that this restriction seems a bit arbitrary.