Uploaded image for project: 'Swift'
  1. Swift
  2. SR-9654

Swift 5: Compiler crashes on SILGen for subscript with autoclosure argument

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Environment:

      5.0-DEVELOPMENT-SNAPSHOT-2019-01-13-a

      Apple Swift version 5.0-dev (LLVM ed64f75263, Clang e5012f3421, Swift 5a827a9558)

      Target: x86_64-apple-darwin18.2.0

      Description

      This code crashes the compiler when code coverage is enabled:

      struct S {
        subscript(i: Int, autoclosure: @autoclosure () ->  Int) -> Int {
          get {
            return 0
          }
          set {
      
          }
        }
      }
      

      I am using the latest (5.0-DEVELOPMENT-SNAPSHOT-2019-01-13-a) snapshot.

      The SPM project to reproduce the issue: https://github.com/broadwaylamb/CompilerCrasherAutoclosureSubscript

      Run:

      $ swift build
      $ swift test --enable-code-coverage
      

      --enable-code-coverage is important.

        Attachments

          Activity

            People

            Assignee:
            vedantk Vedant Kumar
            Reporter:
            broadway_lamb Sergej Jaskiewicz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: