mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Since 865e80f9c4 we are keeping track of internal closure labels in the closure’s type. With this change, wer are also serializing them to the swiftmodules.
Furthermore, this change adjusts the printing behaviour to print the parameter labels in the swiftinterfaces.
Resolves rdar://63633158
81 lines
2.2 KiB
Plaintext
81 lines
2.2 KiB
Plaintext
import SwiftOnoneSupport
|
|
|
|
func foo(_ callback: (_ myInternalParam: Int) -> Void)
|
|
|
|
|
|
[
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 0,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 7,
|
|
key.length: 17
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 26,
|
|
key.length: 4
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 31,
|
|
key.length: 3
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.argument,
|
|
key.offset: 35,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.parameter,
|
|
key.offset: 37,
|
|
key.length: 8
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 48,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 50,
|
|
key.length: 15
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.struct,
|
|
key.name: "Int",
|
|
key.usr: "s:Si",
|
|
key.offset: 67,
|
|
key.length: 3
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.typealias,
|
|
key.name: "Void",
|
|
key.usr: "s:s4Voida",
|
|
key.offset: 75,
|
|
key.length: 4
|
|
}
|
|
]
|
|
[
|
|
{
|
|
key.kind: source.lang.swift.decl.function.free,
|
|
key.name: "foo(_:)",
|
|
key.usr: "s:5label3fooyyySiXEF",
|
|
key.offset: 26,
|
|
key.length: 54,
|
|
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>foo</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>callback</decl.var.parameter.name>: <decl.var.parameter.type>(<decl.var.parameter>_ <decl.var.parameter.name>myInternalParam</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.typealias usr=\"s:s4Voida\">Void</ref.typealias></decl.function.returntype></decl.var.parameter.type></decl.var.parameter>)</decl.function.free>",
|
|
key.entities: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.local,
|
|
key.keyword: "_",
|
|
key.name: "callback",
|
|
key.offset: 47,
|
|
key.length: 32
|
|
}
|
|
]
|
|
}
|
|
]
|