Files
swift-mirror/test/SourceKit/Sema/objc_attr_without_import.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

12 lines
363 B
Swift

// RUN: %sourcekitd-test -req=sema %s -- %s > %t.response
// RUN: %FileCheck -input-file=%t.response %s
// This tests that we are not crashing in SILGen.
// CHECK: {{Objective-C interoperability is disabled|@objc attribute used without importing module}}
@objc protocol Communicate {
var name: String { get }
}
class Cat : Communicate {
let name = "Felix"
}