Skip to content

[SR-5942] Swift 4 Migrator handling of ternaries #48501

Open
@josephlord

Description

@josephlord
Previous ID SR-5942
Radar None
Original Reporter @josephlord
Type Bug

Attachment: Download

Environment

Xcode 9 release version. Migrating to minimise inference.

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, Migrator
Assignee None
Priority Medium

md5: 04fdc704cbc442bbb5b67683a60b912f

Issue Description:

The Swift 4 migrator is handling ternary operations that need to be wrapped in a constructor now (and didn't before) quite oddly.

`tableToViewTopConstraint?.priority = isShowingServerUpdating ? 1 : 999`

Should convert to:

`

tableToViewTopConstraint?.priority = UILayoutPriority.RawValue(isShowingServerUpdating ? 1 : 999)

`

But actually converted to:

`tableToViewTopConstraint?.priority = UILayoutPriority(rawValue: UILayoutPriority.RawValue(isShowingServerUpdating ? 1 : 999))`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.migrator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions