Files
swift-mirror/validation-test/compiler_crashers_2_fixed/sr13713.swift
Slava Pestov 96c9456ee8 Sema: Still diagnose '@objc' even if Foundation was imported
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>.
2020-11-17 14:54:34 -05:00

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()
}