Closed
Description
Right now when a Swift module A enables interoperability and imports a C++ module cxxmod
, and Swift module B that consumes it doesn't, the compiler will fail to compile B with the following error:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cxxmod.h"
^
/Users/alex/i/swift/test/Interop/SwiftToCxx/cross-module-refs/Inputs/cxxmod.h:1:1: error: unknown type name 'class'; did you mean 'Class'?
class TestMough {
^
<unknown>:0: note: 'Class' declared here
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cxxmod.h"
^
/Users/alex/i/swift/test/Interop/SwiftToCxx/cross-module-refs/Inputs/cxxmod.h:1:16: error: expected ';' after top level declarator
class TestMough {
^
<unknown>:0: error: could not build Objective-C module 'cxxmod'
The diagnostic should be improved to be more clear that the client needs to enable interoperability.