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

[3/y] Fix unavailable generic protocol mock initializer #251

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

andrewchang-bird
Copy link
Contributor

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

Stack:
πŸ“š #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

Mock initializer functions were not migrated to use the new templates in 0.18. This caused unavailable generic protocols (e.g. inheriting from an opaque external type) to generate malformed output.

Before

// error: Consecutive statements on a line must be separated by ';'
public enum InheritingMissingExternalClassGeneric<T> {
}@available(*, unavailable, message: "'InheritingMissingExternalClassGeneric' inherits from the externally-defined type 'CBCentralManager' which needs to be declared in a supporting source file")

After

public enum InheritingMissingExternalClassGeneric<T> {
}
@available(*, unavailable, message: "'InheritingMissingExternalClassGeneric' inherits from the externally-defined type 'CBCentralManager' which needs to be declared in a supporting source file")

@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/fix-multiproj-caching branch from 560e0d0 to e73c911 Compare January 6, 2022 04:21
Base automatically changed from dev/andrewchang-bird/fix-multiproj-caching to master January 6, 2022 05:40
@andrewchang-bird andrewchang-bird force-pushed the dev/andrewchang-bird/fix-unavailable-init branch from 8f310c2 to 08a053e Compare January 6, 2022 05:44
@andrewchang-bird andrewchang-bird merged commit 2513e29 into master Jan 6, 2022
@andrewchang-bird andrewchang-bird deleted the dev/andrewchang-bird/fix-unavailable-init branch January 6, 2022 06:18
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.

None yet

2 participants