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

NSProxy can not be subclassed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Environment:

      Xcode 7.3.1 default toolchain

      Description

      Hi,

      The following simple code

      class MyProxy: NSProxy {
        init(value : Int) {
        } // Compiler error here
      }
      

      gives

      Super.init isn't called on all paths before  returning from initializer
      

      compiler error.

      I can't call super.init() because NSProxy class does not have one.

      This means a Swift type can not be subclasses from NSProxy class.

      Is this intentional? If so, I think this class should be unavailable while writing Swift code, or at least have a warning in documentation or code reference.

        Attachments

          Activity

            People

            • Assignee:
              step Step Christopher
              Reporter:
              manuyavuz Yavuz Nuzumlali
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: