Files
swift-mirror/test/SymbolGraph/Something/Something.swift
Ashley Garland 635550cd83 [SymbolGraph] Check Loc validity before extracting text
Hit this crash while walking an `import protocol ...` declaration.
Check loc validity before calling `SourceManager::extractText`:
there is an assertion at the beginning of this function.

rdar://65258208
2020-08-07 13:53:22 -07:00

16 lines
621 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %S/Inputs/SomeProtocol.swift -module-name SomeProtocol -emit-module -emit-module-path %t/
// RUN: %target-build-swift %s -module-name Something -emit-module -emit-module-path %t/ -I %t
// RUN: %target-swift-symbolgraph-extract -module-name Something -I %t -pretty-print -output-dir %t
// RUN: %FileCheck %s --input-file %t/Something.symbols.json
import protocol SomeProtocol.P
public struct MyStruct: P {
public func foo() {}
}
// CHECK: "kind": "conformsTo",
// CHECK-NEXT: "source": "s:9Something8MyStructV",
// CHECK-NEXT: "target": "s:12SomeProtocol1PP",