Skip to content

[SR-10084] Bogus invalid redeclaration error for static func whose signature is same as any case in Enum #52486

@an0

Description

@an0
mannequin
Previous ID SR-10084
Radar None
Original Reporter @an0
Type Bug
Status Resolved
Resolution Done
Environment

Swift 5

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @theblixguy
Priority Medium

md5: 126719b9fe75444b25b26161922488c9

Issue Description:

struct SSS {
    let name: String
}

enum EEE {
    case foo(SSS)
    
    // This triggers "invalid redeclaration of 'foo'" but shouldn't because the parameter type and associated value type is different.
    static func foo(_ name: String) -> EEE {
        return .foo(SSS(name: name))
    }
}

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions