Skip to content

Swift 5.2 support (Xcode 11.4) #668

@rjchatfield

Description

@rjchatfield

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 
    }
    ...
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions