Skip to content

[SR-5836] Compilation crash in Dictionary extension #48406

@jlukas

Description

@jlukas
Previous ID SR-5836
Radar rdar://problem/34259886
Original Reporter @jlukas
Type Bug
Status Resolved
Resolution Done
Environment

Apple Swift version 4.0 (swiftlang-900.0.63.10 clang-900.0.36)

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

md5: b156cf3bcf7a4c66c58b83a54c3dae1b

is duplicated by:

  • SR-5932 Segmentation fault: 11 when creating a Set of optionals

Issue Description:

I'm not sure what exactly is causing the crash, but I reduced it this far:

Input:

extension Dictionary {
    func doSomething<T>() -> [T:Value] {
        let pairs: [(T,Value)] = []
        return Dictionary(uniqueKeysWithValues: pairs)
    }
}

Output:

Stack dump:
0.  While emitting SIL for 'doSomething()' at /var/folders/my/75k1c85j1s5fj3myg_4x273r0000gn/T/repl1-bcce9c..swift:2:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions