mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Adds a new frontend option "-experimental-allow-module-with-compiler-errors". If any compilation errors occur while generating the .swiftmodule, this mode will skip SIL entirely and only serialize the (likey invalid) AST. This existence of this option during generation is serialized into the resulting .swiftmodule. Errors found in deserialization are only allowed if it is set. Primarily intended for IDE requests (eg. indexing and code completion) to ensure robust cross-module results, despite possible errors. Resolves rdar://69815975
15 lines
564 B
Swift
15 lines
564 B
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// The module should be generated regardless of errors and diagnostic should still be output
|
|
// RUN: %target-swift-frontend -verify -emit-module -o %t/errors.swiftmodule -experimental-allow-module-with-compiler-errors %s
|
|
// RUN: llvm-bcanalyzer %t/errors.swiftmodule | %FileCheck -check-prefix=CHECK-BC %s
|
|
// CHECK-BC-NOT: UnknownCode
|
|
|
|
struct InvalidStruct {
|
|
let memberMissingType: undefined // expected-error {{cannot find type 'undefined'}}
|
|
}
|
|
|
|
func invalidFunc() -> InvalidStruct {
|
|
ret // expected-error {{cannot find 'ret'}}
|
|
}
|