I wrote a dummy function builder and my issue is that with my implementation, I am able to write this:
bar<Int> {
baz()
baz()
}
This:
bar<Int> {
baz()
}
Fails with the following error:
Argument passed to call that takes no arguments
I heard there might be issues with the single argument buildBlock in the current implementation, but I'm not sure of wether it's a bug or if it's me doing something wrong?
Thank you
EDIT: I'm using Xcode b2, but also tested it with the latest Swift trunk snapshot and it didn't change anything.
I'm pretty suspicious that your single argument buildBlock doesn't mention T at all. How is the compiler supposed to infer T in that case? What if you add a A.Tag == T clause there?
Even if that fixes it though, I think the error message could use work, so you should consider filing a bug to improve the diagnostic.
I think this is a bug in the current implementation. If you have zero or one elements in the function builder body, the type checker gets confused by the single-expression closure type inference that would normally be in effect. cc @John_McCall