Thank you for the explanation. With clearing the actions I succeeded with your proposal.
However I wanted to add some actions to the array too, but then I hit the wall again - I guess for similar reasons, which makes me wonder if I'm on the right track now.
Member 'addElement' cannot be used on value of type 'any P'; consider using a generic constraint instead
Here is my latest code snippet for this (as someone at the swift repo replied as well): https://github.com/apple/swift/issues/62219#issuecomment-1326163588
Maybe in general: Is it possible to have a generic protocol with associated type, which is based on another protocol that uses another associated type?
Post
Replies
Boosts
Views
Activity
Thanks. I have filed a bug on the Swift project: https://github.com/apple/swift/issues/62219
The Feedback ID: FB11811647
This is more complex than you might think. For the moment, let’s rewrite your testFunc() method like so:
Thank you for the code, but this does result in the same crash for me.
I would have expected that the type of d is (any TestDelegate) therefore it will identify actions as being of type [ActionType]. And then in the actual implementation it would get resolved into [Action]. Shouldn't I expect this automatic deduction? Or am I doing something conceptually wrong?
Same issue still happens.
Anyone found some explanation?