[SR-2912] Compiler crashes on Objective-C code that is broken due to a missing define #45506
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
serialization
Area → compiler: Serialization & deserialization
Attachment: Download
Environment
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: 48892a42695da5c3376568c42b84f14d
Issue Description:
Suppose we have an Objective-C class, which existence is gated by a preprocessor define:
And a Swift class Foo (module Foo) which uses CModule
If we compile Foo without the define flag, we get this nice error message:
Let's add
-Xcc -DCMODULE_ENABLED
to the compilation of Foo fixing the issue.Then create another Swift class Bar (module Bar) that depends on Foo:
And compile it, again, without setting the define:
1. While it's not surprising that Bar cannot be compiled, the compiler should show the same error message as we've seen with Foo, instead of crashing.
2. Should this actually compile, since Foo has all the information about C types it needs, and Bar is not really using any of it?
Sample crasher attached. Unpack and run build.sh.
The text was updated successfully, but these errors were encountered: