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

typealias for function signature on multiple lines ignores all but 1st line #1148

Closed
DivineDominion opened this issue Jan 6, 2020 · 4 comments · Fixed by #1149
Closed

typealias for function signature on multiple lines ignores all but 1st line #1148

DivineDominion opened this issue Jan 6, 2020 · 4 comments · Fixed by #1149
Labels

Comments

@DivineDominion
Copy link

DivineDominion commented Jan 6, 2020

Here's what we have in ReSwift, a typealias on 2 lines:

public typealias Middleware<State> = (@escaping DispatchFunction, @escaping () -> State?)
    -> (@escaping DispatchFunction) -> DispatchFunction

Here's what jazzy generates:

public typealias Middleware<State> = (@escaping DispatchFunction, @escaping () -> State?)

(See our docs)

I tried this with a clean install of the latest 0.13.0 and the result is the same.

@johnfairh
Copy link
Collaborator

For now you'll need to include all the declaration on the same line.

It's going wrong due to a cascade of historical Swift bugs unfortunately:

SR-6321 was fixed in Swift 4.2 so we could maybe remove the workaround now?
Or at least teach the workaround about the possibility of a fix.

Each time I've tried to fix 896 a new problem in the Swift compiler has got in the way - will make my annual attempt this week and see how Swift 5.1 is.

@DivineDominion
Copy link
Author

Oh man that sounds way more horrible than I would've expected. Fingers crossed!

@johnfairh
Copy link
Collaborator

Fixed the 'truncated' part; remaining 'should be on two lines' part is tracked by 896.

@DivineDominion
Copy link
Author

Great, it works now 🙌 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants