Skip to content

[SR-12395] Fixit uses different generic type spelling than the protocol requirement #54832

@swift-ci

Description

@swift-ci
Previous ID SR-12395
Radar rdar://problem/60832868
Original Reporter cukier (JIRA User)
Type Bug
Environment

Xcode Version 11.4 beta 3 (11N132i)

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: b589a50929b998bd5fc09f8ee2142706

Issue Description:

if you have

typealias Zzz = FloatingPoint
protocol Proto {
    func hello<T: Zzz>() -> T
}

struct Foo: Proto {
}

and use a fixit to add protocol stubs, you get

    func hello<T>() -> T where T : FloatingPoint {
        <#code#>
    }

which doesn't use the shorthand type constraint syntax, and doesn't use the typealias.
I would've expected fixit to insert the following text:

    func hello<T: Zzz>() -> T {
        <#code#>
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions