I've generally been in favor of the "put protocol conformance in extensions" approach that @dimsumthinking advocates.
But chasing down "Main actor-isolated property '...' cannot be used to satisfy nonisolated protocol requirement" warnings, when you can't figure out what protocol is being referenced and it isn't done in this file? yeah… got me questioning myself on that.
=> More informations about this toot | More toots from cocoaphony@mastodon.social
@cocoaphony I like the extensions, but I like to put everything for a single type in the same file.
=> More informations about this toot | More toots from jsq@mastodon.social
@cocoaphony @dimsumthinking A) This sounds like potentially just poor diagnostics maybe?
B) do you never do the preconcurrency conformance thing just to make it work?
C) are you as excited for “isolated conformances” as I am from the vision doc?
=> More informations about this toot | More toots from mattiem@mastodon.social
@mattiem @dimsumthinking
A) If it told me the protocol it would certainly help a lot.
B) No
C) Yes. But in this case, I control all the pieces. It’s our protocol and our conformance. So I don’t think isolated conformances really apply.
1/
=> More informations about this toot | More toots from cocoaphony@mastodon.social
@mattiem @dimsumthinking
But I’m also not quite certain that isolated conformances will be as useful as we would hope.
Excited as I am for the vision (and I really am!) the words “SwiftUI” and “UIKit” never appear. So I don’t know how the vision will translate in terms of “works for iOS devs.” Will this vision help us with Combine? NotificationCenter? Hard to be sure. (Have you heard more explicit discussion about that?)
=> More informations about this toot | More toots from cocoaphony@mastodon.social
@cocoaphony @dimsumthinking I would really love to file bugs about poor diagnostics and note them in the forum thread asking about that. They have improved in 6.1, but there’s move work to do.
=> More informations about this toot | More toots from mattiem@mastodon.social
@cocoaphony @dimsumthinking Now, isolated conformances were invented to address exactly the error you quoted. It’s quite common. But today, you can sometimes emulate the effect with a preconcurrency conformance. You could definitely check this out. And it that does not help, digging in to why might be good vision feedback on that specific feature.
=> More informations about this toot | More toots from mattiem@mastodon.social
@cocoaphony @dimsumthinking For your higher-level question. I think that the language team has done a phenomenal job of examining framework-specific problems closely, finding, and generalizing solutions. This is not always possible, of course. But way more than I expected. I didn’t see isolated overrides coming, and this directly addresses big UIKit/AppKit issues.
=> More informations about this toot | More toots from mattiem@mastodon.social
@mattiem @dimsumthinking in this case, the fix for the wRning was to delete the protocol. We didn’t even need it. :)
That’s one reason I hesitate to reach for preconcurrency opt-outs too quickly. I see them as an escape hatch for times when we’re stuck. Before I do that, I want to explore whether there’s a better fix. Often we improve the code rather than just clearing the warning.
=> More informations about this toot | More toots from cocoaphony@mastodon.social
@cocoaphony @dimsumthinking Ok yes but preconcurrency conformances specifically behave in such a way that they are not really an opt-out. They are adding a (severe) runtime constraint in exchange for relaxed compile-time checking. But that’s often exactly what you want and was kind of an inspiration for isolated conformances.
If feels weird, yes, but it works super well.
=> More informations about this toot | More toots from mattiem@mastodon.social
@cocoaphony @dimsumthinking However I, or course, agree that if you can solve the problem another way you should!
=> More informations about this toot | More toots from mattiem@mastodon.social
@mattiem @dimsumthinking Agreed. https://github.com/swiftlang/swift/issues/78518
=> More informations about this toot | More toots from cocoaphony@mastodon.social This content has been proxied by September (ba2dc).Proxy Information
text/gemini