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

Swift 5.2 support (Xcode 11.4) #668

Closed
rjchatfield opened this issue Feb 5, 2020 · 5 comments
Closed

Swift 5.2 support (Xcode 11.4) #668

rjchatfield opened this issue Feb 5, 2020 · 5 comments
Assignees
Milestone

Comments

@rjchatfield
Copy link

rjchatfield commented Feb 5, 2020

Macaw doesn't compile with Swift 5.2 included in Xcode 11.4 beta 1.

There are 4 compilation failures that I saw. This was in Gradient.swift:

image

Error message:

Overridden method 'equals' has generic signature <T where T : Gradient> which is incompatible with base method's generic signature <T where T : Fill>; expected generic signature to be <T where T : Fill>

Perhaps as a workaround to this to change the T: Gradient up to the expected T: Fill and the guard on the first line to cast it to the expected type, else false:

// Before:
override func equals<T>(other: T) -> Bool where T: Gradient {
    ...
}
// Suggestion:
override func equals<T>(other: T) -> Bool where T: Fill {
    guard let other = other as? Gradient else { 
        return false 
    }
    ...
}
@rjchatfield rjchatfield changed the title Swift 5.2 support Swift 5.2 support (Xcode 11.4) Feb 6, 2020
@amarunko
Copy link
Contributor

amarunko commented Feb 7, 2020

Hi, @rjchatfield, first of all, thank you for the suggestion, you are welcome to send a PR

@amarunko
Copy link
Contributor

amarunko commented Feb 8, 2020

Yea, you are right this is an appropriate solution. I created a draft PR for new beta

@khlopko
Copy link

khlopko commented Mar 25, 2020

Hello! Any updates on that?

@premedios
Copy link

The proposed changes worked. Waiting on release of new version.

@ystrot ystrot self-assigned this Mar 26, 2020
@ystrot ystrot added this to the 0.9.6 milestone Mar 26, 2020
@ystrot
Copy link
Member

ystrot commented Mar 26, 2020

Merged into master.

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

No branches or pull requests

5 participants