mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In a mixed Objective-C / Swift module, we have a Clang module overlay that’s a Source file, not a serialized AST as is currently assumed. That assumption caused a crash when retrieving the symbol graph as part of a cursor info request to SourceKit, which was invoked on a method defined in the Objective-C part of the module. To fix the crash, recursively use the same logic that already exists to serialize a module to also serialize the clang overlay module since that function alreayd correctly handles the distinction between source files and serialized ASTs. Resolves rdar://76951147
10 lines
360 B
Swift
10 lines
360 B
Swift
// RUN: %empty-directory(%t.mcp)
|
|
|
|
public class MySwiftType {
|
|
public func bar(x: MyObjcType) {
|
|
// Check that we don't crash
|
|
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 1):11 -req-opts=retrieve_symbol_graph=1 %s -- -module-name MixedFramework -F %S/Inputs/mixed_framework -import-underlying-module -module-cache-path %t.mcp %s
|
|
x.foo()
|
|
}
|
|
}
|