Skip to content

Use Swift 4.1's ability to wrap directives around switch cases #345

@ZevEisenberg

Description

@ZevEisenberg

https://bugs.swift.org/browse/SR-2 was resolved in Swift 4.1.

Affects this code in StringStyle+Part.swift:

        case let .emphasis(emphasis):
            self.emphasis = emphasis
        default:
            // interaction between `#if` and `switch` is disappointing. This case
            // is in `default:` to remove a warning that default won't be accessed
            // on some platforms.
            switch stylePart {
            case let .hyphenationFactor(hyphenationFactor):
                self.hyphenationFactor = hyphenationFactor
            default:
                #if os(iOS) || os(tvOS) || os(watchOS)
                    switch stylePart {
                    case let .speaksPunctuation(speaksPunctuation):
                        self.speaksPunctuation = speaksPunctuation
                        return

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions