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

Compiler crash for redeclaration in extension of generic type

    XMLWordPrintable

    Details

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

      Swift version 4.2-dev (LLVM cef3fe6d75, Clang bdc970d89c, Swift 5b60ace4b3)
      Target: x86_64-apple-darwin17.4.0

      Description

      The following code crashes the compiler:

      struct S<T> {
        var x: Int { return 0 }
      }
      
      extension S {
        var x: Int { return 0 }
      }
      

      It triggers an assertion in SILGen, but really Sema should catch this with an invalid redeclaration error.

        Attachments

          Activity

            People

            Assignee:
            originaluser2 Hamish Knight
            Reporter:
            originaluser2 Hamish Knight
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: