mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce a `getTopmostDeclarationDeclContext` utility to ensure we ensure we don't visit a `nullptr` DeclContext for an erroneous module under `-experimental-allow-module-with-compiler-errors`. Additionally, tweak the insertion location such that we insert at the start of any attributes present. rdar://97267326
10 lines
472 B
Swift
10 lines
472 B
Swift
// RUN: %empty-directory(%t)
|
||
|
||
// RUN: %target-swift-frontend -verify -emit-module -experimental-allow-module-with-compiler-errors %s -o %t/foo.swiftmodule
|
||
// RUN: %target-swift-frontend -verify -emit-module -module-name foo %t/foo.swiftmodule
|
||
|
||
// rdar://97267326 – Make sure we can handle an operator function without its declaration.
|
||
struct S {
|
||
static func ^^^ (lhs: S, rhs: S) {} // expected-error {{operator implementation without matching operator declaration}}
|
||
}
|