Files
swift-mirror/test/ClangImporter/objc_protocol_renaming.swift
Doug Gregor 769a40c2b5 [Type checker] Don't try to infer @objc from unavailable requirements.
@objc inference was looking at unavailable requirements---for which we
don't ever record witnesses---at a point when it is no longer possible
to record such a witness. This is a targeted fix; we need to tackle
the issue of unavailable and optional requirements more thoroughly.

Fixes SR-3917 / rdar://problem/30474860.
2017-02-13 23:12:14 -08:00

21 lines
1.2 KiB
Swift

// RUN: rm -rf %t && mkdir -p %t
// FIXME: BEGIN -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -emit-module -o %t %clang-importer-sdk-path/swift-modules/CoreGraphics.swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t %clang-importer-sdk-path/swift-modules/Foundation.swift
// FIXME: END -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %S/Inputs/custom-modules -I %t) -emit-module -o %t %S/Inputs/ImplementProtoRenaming.swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %S/Inputs/custom-modules -I %t) -typecheck %s -verify
// REQUIRES: objc_interop
import ProtoRenaming
import ImplementProtoRenaming
// SR-3917: compiler crash when using an "old" name for an imported requirement
class MyGraphViewSubclass : MyGraphView {
func doSomethingToGraphView(_ view: GraphView) { } // expected-error{{method 'doSomethingToGraphView' with Objective-C selector 'doSomethingToGraphView:' conflicts with method 'doSomething(to:)' from superclass 'MyGraphView' with the same Objective-C selector}}
}