mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We checked for an import of a module named 'Foundation' before checking if Objective-C interoperability was enabled, which would lead to hilarious results. Fixes <https://bugs.swift.org/browse/SR-13713> / <rdar://problem/70140319>.
11 lines
319 B
Swift
11 lines
319 B
Swift
// RUN: %target-typecheck-verify-swift -disable-objc-interop -module-name Foundation
|
|
|
|
// Make sure we diagnose this even if the current module is named 'Foundation':
|
|
@objc protocol Horse { // expected-error {{Objective-C interoperability is disabled}}
|
|
func ride()
|
|
}
|
|
|
|
func rideHorse(_ horse: Horse) {
|
|
horse.ride()
|
|
}
|