[swift-evolution] [Pitch] Moving where Clauses Out Of Parameter Lists

Brent Royal-Gordon brent at architechies.com
Thu Apr 7 00:12:57 CDT 2016

> I know you're not proposing that feature right now, but want to understand how you expect it to work.  It looks to me like this starts to enter design by contract territory.  Would the predicate behave as if it was part of a precondition?

I suppose I imagine it as equivalent to a precondition() placed at the call site, rather than inside the function. If the compiler can prove that the precondition will be violated, it can refuse to compile the call. But I haven't thought deeply about it, so I don't really know for sure.

Brent Royal-Gordon

More information about the swift-evolution mailing list