mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
74 lines
1.4 KiB
Swift
74 lines
1.4 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
// RUN: %sourcekitd-test -req=signaturehelp -pos=16:8 %t/input.swift -- %t/input.swift > %t/actual.result
|
|
// RUN: diff -u %t/expected.result %t/actual.result
|
|
|
|
//--- input.swift
|
|
struct Matrix {
|
|
subscript(row: Int, column: Int) -> Int {
|
|
return 0
|
|
}
|
|
|
|
subscript(row r: Int) -> [Int] {
|
|
return []
|
|
}
|
|
|
|
subscript(column c: Int) -> [Int] {
|
|
return []
|
|
}
|
|
}
|
|
|
|
let matrix = Matrix()
|
|
matrix[]
|
|
|
|
//--- expected.result
|
|
{
|
|
key.signatures: [
|
|
{
|
|
key.name: "subscript(keyPath: KeyPath<Matrix, Value>) -> Value",
|
|
key.parameters: [
|
|
{
|
|
key.nameoffset: 10,
|
|
key.namelength: 31
|
|
}
|
|
],
|
|
key.active_parameter: 0
|
|
},
|
|
{
|
|
key.name: "subscript(row: Int, column: Int) -> Int",
|
|
key.parameters: [
|
|
{
|
|
key.nameoffset: 10,
|
|
key.namelength: 8
|
|
},
|
|
{
|
|
key.nameoffset: 20,
|
|
key.namelength: 11
|
|
}
|
|
],
|
|
key.active_parameter: 0
|
|
},
|
|
{
|
|
key.name: "subscript(row: Int) -> [Int]",
|
|
key.parameters: [
|
|
{
|
|
key.nameoffset: 10,
|
|
key.namelength: 8
|
|
}
|
|
],
|
|
key.active_parameter: 0
|
|
},
|
|
{
|
|
key.name: "subscript(column: Int) -> [Int]",
|
|
key.parameters: [
|
|
{
|
|
key.nameoffset: 10,
|
|
key.namelength: 11
|
|
}
|
|
],
|
|
key.active_parameter: 0
|
|
}
|
|
],
|
|
key.active_signature: 0
|
|
}
|