Files
swift-mirror/test/Serialization/AllowErrors/invalid-operator.swift
Hamish Knight cfd24354e1 [Sema] Fix missing operator diagnostic logic
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
2022-07-28 12:55:53 +01:00

10 lines
472 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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}}
}