Skip to content
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

[9/y] Fix nested optional codegen #248

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

andrewchang-bird
Copy link
Contributor

@andrewchang-bird andrewchang-bird commented Dec 24, 2021

Stack:
πŸ“š #248 ← [9/y] Fix nested optional codegen
πŸ“š #247 [8/y] Fix wildcard arg matching for Obj-C param types
πŸ“š #246 [7/y] Fix stubbing nil values in Obj-C mocks
πŸ“š #254 [6/y] Update example projects
πŸ“š #253 [5/y] Improve support for configuring SPM Xcode projects
πŸ“š #252 [4/y] Show help message no mockable types are generated
πŸ“š #251 [3/y] Fix unavailable generic protocol mock initializer
πŸ“š #250 [2/y] Fix generator caching for multi-project setups
πŸ“š #249 [1/y] Optimize dependency graph traversal
πŸ“š #245 Replace SwiftPM with Swift Argument Parser

This fixes the implicit type coercion when bridging nested optional property setters to Any? for dynamic mocking.

Before

// warning: Expression implicitly coerced from 'String??' to 'Any?'
if let mkbImpl = mkbImpl as? (Any?) -> Any? { return Mockingbird.dynamicCast(mkbImpl(newValue)) as Void }

After

if let mkbImpl = mkbImpl as? (Any?) -> Any? { return Mockingbird.dynamicCast(mkbImpl(newValue as Any?)) as Void }

@andrewchang-bird andrewchang-bird added this to the Release 0.19 milestone Dec 24, 2021
@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/fix-objc-parameters branch from 81d2134 to 8b03fb6 Compare January 4, 2022 22:21
@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/fix-nested-optionals branch from 9f275f6 to f17b2a0 Compare January 4, 2022 22:21
@andrewchang-bird andrewchang-bird changed the title [3/x] Fix nested optional codegen [9/y] Fix nested optional codegen Jan 5, 2022
@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/fix-objc-parameters branch from 8b03fb6 to 1bd6c0d Compare January 6, 2022 09:36
Base automatically changed from dev/andrewchang-bird/fix-objc-parameters to master January 6, 2022 11:47
This fixes the implicit type coercion when bridging nested optional
property setters to `Any?` for dynamic mocking.
@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/fix-nested-optionals branch from f17b2a0 to 249de79 Compare January 6, 2022 11:51
@andrewchang-bird andrewchang-bird merged commit 50f3259 into master Jan 6, 2022
@andrewchang-bird andrewchang-bird deleted the dev/andrewchang-bird/fix-nested-optionals branch January 6, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants