mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If a module has the same `public-module-name` as the module being
generated and its import is exported, merge it into the same generated
interface.
Fix various always-imported modules from being printed while here and
update all the tests that checked for them.
Resolves rdar://137887712.
(cherry picked from commit ddddc667c8)
211 lines
4.3 KiB
Plaintext
211 lines
4.3 KiB
Plaintext
public class MyClass {
|
|
|
|
public func pub_method()
|
|
|
|
deinit
|
|
}
|
|
|
|
public protocol MyProto<Assoc> {
|
|
|
|
associatedtype Assoc
|
|
}
|
|
|
|
@discardableResult
|
|
public func pub_function() -> Int
|
|
|
|
|
|
[
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
|
|
key.offset: 0,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 7,
|
|
key.length: 5
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 13,
|
|
key.length: 7
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
|
|
key.offset: 28,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 35,
|
|
key.length: 4
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 40,
|
|
key.length: 10
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 58,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
|
|
key.offset: 68,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 75,
|
|
key.length: 8
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 84,
|
|
key.length: 7
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 92,
|
|
key.length: 5
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 106,
|
|
key.length: 14
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 121,
|
|
key.length: 5
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
|
|
key.offset: 130,
|
|
key.length: 18
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
|
|
key.offset: 149,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.keyword,
|
|
key.offset: 156,
|
|
key.length: 4
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.identifier,
|
|
key.offset: 161,
|
|
key.length: 12
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.typeidentifier,
|
|
key.offset: 179,
|
|
key.length: 3
|
|
}
|
|
]
|
|
[
|
|
{
|
|
key.kind: source.lang.swift.ref.associatedtype,
|
|
key.offset: 92,
|
|
key.length: 5
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.ref.struct,
|
|
key.offset: 179,
|
|
key.length: 3,
|
|
key.is_system: 1
|
|
}
|
|
]
|
|
[
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.public,
|
|
key.name: "MyClass",
|
|
key.offset: 7,
|
|
key.length: 59,
|
|
key.nameoffset: 13,
|
|
key.namelength: 7,
|
|
key.bodyoffset: 22,
|
|
key.bodylength: 43,
|
|
key.attributes: [
|
|
{
|
|
key.offset: 0,
|
|
key.length: 6,
|
|
key.attribute: source.decl.attribute.public
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.public,
|
|
key.name: "pub_method()",
|
|
key.offset: 35,
|
|
key.length: 17,
|
|
key.nameoffset: 40,
|
|
key.namelength: 12,
|
|
key.attributes: [
|
|
{
|
|
key.offset: 28,
|
|
key.length: 6,
|
|
key.attribute: source.decl.attribute.public
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.protocol,
|
|
key.accessibility: source.lang.swift.accessibility.public,
|
|
key.name: "MyProto",
|
|
key.offset: 75,
|
|
key.length: 53,
|
|
key.nameoffset: 84,
|
|
key.namelength: 7,
|
|
key.bodyoffset: 100,
|
|
key.bodylength: 27,
|
|
key.attributes: [
|
|
{
|
|
key.offset: 68,
|
|
key.length: 6,
|
|
key.attribute: source.decl.attribute.public
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.associatedtype,
|
|
key.accessibility: source.lang.swift.accessibility.public,
|
|
key.name: "Assoc",
|
|
key.offset: 106,
|
|
key.length: 20,
|
|
key.nameoffset: 121,
|
|
key.namelength: 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.free,
|
|
key.accessibility: source.lang.swift.accessibility.public,
|
|
key.name: "pub_function()",
|
|
key.offset: 156,
|
|
key.length: 26,
|
|
key.typename: "Int",
|
|
key.nameoffset: 161,
|
|
key.namelength: 14,
|
|
key.attributes: [
|
|
{
|
|
key.offset: 149,
|
|
key.length: 6,
|
|
key.attribute: source.decl.attribute.public
|
|
},
|
|
{
|
|
key.offset: 130,
|
|
key.length: 18,
|
|
key.attribute: source.decl.attribute.discardableResult
|
|
}
|
|
]
|
|
}
|
|
]
|