Skip to content

[SR-8180] Migrator inserts unresolvable type RawValue when migrating to new enums #50712

Open
@ChristopherRogers

Description

@ChristopherRogers
Previous ID SR-8180
Radar rdar://problem/44582517
Original Reporter @ChristopherRogers
Type Bug

Attachment: Download

Environment

Xcode 10.0 beta 3 (10L201y)

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

md5: 7deb6a8b2a22152df317be5955d289b5

Issue Description:

Migrating this Swift 4.0 code to 4.2 results in the following build errors. (The resulting code is commented out.)

import UIKit

var window: UIWindow?

func foo() {
    // error: use of unresolved identifier 'RawValue'
    // window!.windowLevel = UIWindow.Level(rawValue: RawValue(Int(window!.windowLevel.rawValue) + 1))
    window!.windowLevel = window!.windowLevel + 1

    let view = UIView()
    let isSelected = true
    // error: use of unresolved identifier 'RawValue'
    // view.accessibilityTraits = isSelected ? UIAccessibilityTraits(rawValue: RawValue(UInt8(UIAccessibilityTraits.button.rawValue) | UInt8(UIAccessibilityTraits.selected.rawValue))) : UIAccessibilityTraits.button
    view.accessibilityTraits = isSelected ? UIAccessibilityTraitButton | UIAccessibilityTraitSelected : UIAccessibilityTraitButton
}

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