Revision 42e827e6e7247224c068a9dce8f6eabd2ab892ba authored by Devin Coughlin on 21 January 2016, 00:12:56 UTC, committed by Devin Coughlin on 21 January 2016, 01:22:15 UTC
1 parent ac1f5a6
Raw File
objc_init_conformance.swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse %s -verify

// REQUIRES: objc_interop

// Note: this is in a separate file because -verify doesn't complain
// about diagnostics from other files.
import Foundation
import AppKit

// Okay to use an Objective-C-defined initializer to satisfy an
// initializer requirement in a protocol.
protocol URLInitializable {
  init?(URL: String!)
}

extension URLDocument : URLInitializable { }

// Okay to satisfy an 'init' requirement with an 'init!'.
protocol IntInitializable {
  init(int value: Int)
}

extension NSTableViewController : IntInitializable {
}

func testInitWithIntIUO() {
  let tvc = NSTableViewController(int: 5)
  if tvc == nil { }
}


back to top