Files
swift-mirror/test/ClangModules/objc_init_redundant.swift
Jordan Rose e5b8ff9e84 Continue tweaking the wording of the ObjC selector conflict diagnostics.
Per feedback from Doug. More rdar://problem/19927828

Swift SVN r25740
2015-03-04 02:25:04 +00:00

22 lines
1.1 KiB
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk -I %S/Inputs/custom-modules) -emit-sil %s -verify
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk -I %S/Inputs/custom-modules) -emit-sil %s > %t.log 2>&1
// RUN: FileCheck %s < %t.log
// REQUIRES: objc_interop
import Foundation
// rdar://problem/17687082
extension NSObject {
convenience init() { self.init() } // expected-error{{initializer 'init()' with Objective-C selector 'init' conflicts with previous declaration with the same Objective-C selector}}
// CHECK: objc_init_redundant.swift:[[@LINE-1]]:15: error: initializer 'init()' with Objective-C selector 'init' conflicts
// CHECK: ObjectiveC.NSObject{{.*}}note: 'init' previously declared here
}
extension NSObject {
@objc(class) func foo() { } // expected-error{{method 'foo()' with Objective-C selector 'class' conflicts with method 'class()' with the same Objective-C selector}}
// CHECK: objc_init_redundant.swift:[[@LINE-1]]:21: error: method 'foo()' with Objective-C selector 'class' conflicts
// CHECK: ObjectiveC.NSObject{{.*}}note: method 'class()' declared here
}