Re: [swift-users] Compile time tests

2017-03-31 Thread José Manuel Sánchez via swift-users
Excellent! I hadn’t thought that you would need this to test the compiler itself. Would be nice to have some supported and documented way to do this at some point, but it works for me. Regards José Manuel > El 31 mar 2017, a las 11:41, Slava Pestov escribió: > > We have an

Re: [swift-users] Compile time tests

2017-03-31 Thread Slava Pestov via swift-users
We have an undocumented -verify flag you can use for this. Here’s some code that doesn’t type check because the second call to g() is passing a type that does not conform to protocol P: protocol P {} protocol Q {} struct R : P {} struct S : Q {} func g(_: T) {} g(R()) g(S()) //

[swift-users] Compile time tests

2017-03-31 Thread José Manuel Sánchez via swift-users
I don’t know if this has come before (I tried searching but it’s not easy with the mailing lists system); sorry in advance if that’s the case. I’ve been using more generics lately, and I’ve come to a point where it would be really nice to check if my types are correctly specified so that a