Open hassila opened 1 year ago
Thanks for the report! Yeah I guess we need to handle this better; the witness matching here is implemented "manually" and it since it's an ad-hoc requirement (sadly). So we didn't account for just some Error
etc, which changed the count of formal generic parameters to the func.
To doublecheck @hborla @xedin I guess we should support this as it must be possible to implement requirements with a some
type I guess, right? I confirmed this should work:
1> protocol P {
2. func nein<A: Error>(a: A)
3. }
4> struct K: P {
5. func nein(a: some Error) {}
6. }
Separately from that though I think SwiftFormat aggressively rewriting signatures like that is a bit too aggressive... but that's a separate discussion.
Radar to track this rdar://102126743
I thought about this more and agree we must support this. Thanks for reporting!
Describe the bug
Hello everyone!
I’m looking at distributed actors for my project. While building some PoC i found next issue, which i’m not sure is it an issue for compiler or it’s better to file an issue for https://github.com/nicklockwood/SwiftFormat. When I apply swiftformat for my project i get next change:
while the applicable syntax seems to be correct from language point of view it breaks the conformance to DistributedActorSystem, so i get an error:
So, basically it doesn’t like the way how swiftformat changed method signature. If i rollback this particular piece - all work good
Do you think it’s an issue which should be addressed in compiler or should I file a bug for swiftformat that it shouldn’t touch those methods?
Thanks for advice!
Environment Swift 5.7+ .