mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The error shown when the compiler fails to build a module from its textual interface has been creating some confusion. This is a proposal to make it more useful to the programmer not working in the SDK, insist on looking at the previous errors first, put less emphasis on possible compiler bugs, and always show alternatives to the incompatible compilers issue as this is the most common case now.
16 lines
1.3 KiB
Swift
16 lines
1.3 KiB
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// Check that verification won't reject a valid interface:
|
|
// RUN: %target-build-swift -emit-library -enable-library-evolution -emit-module-interface -emit-module -swift-version 5 -o %t/MyModule.o -verify-emitted-module-interface -module-name MyModule %s
|
|
|
|
// Check that verification will reject an invalid interface:
|
|
// RUN: not %target-build-swift -emit-library -enable-library-evolution -emit-module-interface -emit-module -swift-version 5 -o %t/MyModule.o -verify-emitted-module-interface -module-name MyModule -Xfrontend -debug-emit-invalid-swiftinterface-syntax %s 2>&1 | %FileCheck %s
|
|
|
|
// ...but not if verification is off.
|
|
// RUN: %target-build-swift -emit-library -enable-library-evolution -emit-module-interface -emit-module -swift-version 5 -o %t/MyModule.o -no-verify-emitted-module-interface -module-name MyModule -Xfrontend -debug-emit-invalid-swiftinterface-syntax %s
|
|
|
|
public struct MyStruct {}
|
|
|
|
// CHECK: MyModule.swiftinterface:{{[0-9]+}}:{{[0-9]+}}: error: use of unknown directive '#__debug_emit_invalid_swiftinterface_syntax__'
|
|
// CHECK: MyModule.swiftinterface:{{[0-9]+}}:{{[0-9]+}}: error: failed to verify module interface of 'MyModule' due to the errors above; the textual interface may be broken by project issues or a compiler bug
|