mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
12 lines
427 B
Swift
12 lines
427 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
struct S {
|
|
init<T: NSNumber>(_ num: T) { // expected-note {{where 'T' = 'Bool'}}
|
|
self.init(num != 0) // expected-error {{initializer 'init(_:)' requires that 'Bool' inherit from 'NSNumber'}}
|
|
// expected-error@-1 {{cannot convert value of type 'T' to expected argument type 'Int'}}
|
|
}
|
|
}
|