New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-11611] Generic instantiation broken for specific case #54019
Comments
I think we're going to have to see the project to make progress. If you can't share it here, how about filing a Feedback for just the Apple folks to look into it? (https://feedbackassistant.apple.com) @slavapestov, does this sound familiar? |
Comment by Mark Woollard (JIRA) I'll try and get something together that reproduces this and share as suggested. It can probably do that without having to share everything but using the actual code involved above. |
Comment by Mark Woollard (JIRA) I've distilled this down into a much smaller project that reproduces the issue. Zip attached contains project, open the workspace and build and run. Set a breakpoint at `BugCell.swift:19`, compiled with 5.0.1 this breakpoint is hit, compiled with 5.1 it is not. See `UTMVVMC/Set+CellCoordinator.swift:16`. This is where the problem instantiation occurs, with 5.0.1 it instantiates `BugCoordinator`, with 5.1 `CellCoordinator<(), BugCell>` ! |
Thanks for the reduction! @swift-ci create |
Comment by Mark Woollard (JIRA) Is there any idea on timescale to resolution of this, currently its blocking us moving to 5.1 / iOS 13. Some indication would help decide whether to look at a re-architecture or wait. Thanks. |
Comment by Mark Woollard (JIRA) I've discovered something else about this issue. Our app build with Xcode 11.3 / Swift 5.1.3 for release / bitcode and uploaded to iTunes, when processed by Apple and then installed, does not exhibit the bug. Same code compiled locally onto device, or in simulator does. Don't know if that helps ! |
I noticed that the problem does not reproduce on the 5.2 compiler, but I wasn't able to make any progress on figuring out what was going wrong in 5.1. Can you try a 5.2 development snapshot and confirm that the issue has been addressed? |
Comment by Mark Woollard (JIRA) Confirm that example provided here compiles and works correctly with the Jan 16th snapshot. I haven't been able to verify on our main codebase since this version causes compiler error with a third partly pod (Stripe SDK) and not had time to resolve issue. |
Attachment: Download
Additional Detail from JIRA
md5: 0246f94be1e0ded3b759c985ed36a797
Issue Description:
I have some code that is basically:
With Xcode 10.3 / Swift 5.0.1 this works as expected and getC2() return instance of C2. However with Xcode 11.1 / Swift 5.1 getC2() is returning instance of C1<T, CC> and so when `run(a: A)` is called the base class method is called and not the C2 overridden method.
For the real case, `print("(instanceOfInstantiatedClass)")` immediately after the code instantiates an instance as indicated above, same code compiled in the two environments:
Swift 5.0.1 outputs the subclass as expected
`TicketlessCore.ProductCellCoordinator`
Swift 5.1 outputs the base class with generic parameters provided by subclass (and breaks things as the subclass overridden method does not get called).
`UTMMVC.CellCoordinator<UTProducts.TicketProduct, TicketlessCore.ProductCell>`
This is part of large complex project and I've not yet been able to reproduce in simpler form suitable for adding here (but will continue to try to do so). If there's anything else that can help let me know and any suggestions of a work around?
The text was updated successfully, but these errors were encountered: