2 ms·
"Specifying a required method looks like defining a method in an interface type, except that the receiver type must be explicitly provided." This seems fine to
by politician 7y ago
"Specifying a required method looks like defining a method in an interface type, except that the receiver type must be explicitly provided."
This seems fine to me, I don't feel that these features compete in the same way you're suggesting. With interfaces, the receiver type is not constrained; with contracts, it is explicitly provided. Contracts are resolved at compile-time while interfaces are resolved at runtime. That doesn't seem like a stretch, but I'll have to dig in more with the proposal.
If anything, extending the range of const compile-time capabilities is a good thing.