Skip to content

Commit f389bcd

Browse files
committed
[test/SourceKit] Add a test case for a crash that is already fixed
1 parent 829f258 commit f389bcd

File tree

4 files changed

+141
-3
lines changed

4 files changed

+141
-3
lines changed

Diff for: test/SourceKit/DocumentStructure/Inputs/main.swift

+6
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,9 @@ protocol BarProtocol {}
172172
var var_with_didset = 10 {
173173
didSet { print(oldValue) }
174174
}
175+
176+
#if os(iOS)
177+
@objc protocol MyProtocol: NSObjectProtocol {
178+
var thing: NSObject {get}
179+
}
180+
#endif

Diff for: test/SourceKit/DocumentStructure/structure.swift.empty.response

+45-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
key.offset: 0,
3-
key.length: 2689,
3+
key.length: 2787,
44
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
55
key.substructure: [
66
{
@@ -1645,6 +1645,50 @@
16451645
key.namelength: 5,
16461646
key.bodyoffset: 2675,
16471647
key.bodylength: 8
1648+
},
1649+
{
1650+
key.kind: source.lang.swift.decl.protocol,
1651+
key.accessibility: source.lang.swift.accessibility.internal,
1652+
key.name: "MyProtocol",
1653+
key.offset: 2708,
1654+
key.length: 71,
1655+
key.nameoffset: 2717,
1656+
key.namelength: 10,
1657+
key.bodyoffset: 2747,
1658+
key.bodylength: 31,
1659+
key.inheritedtypes: [
1660+
{
1661+
key.name: "NSObjectProtocol"
1662+
}
1663+
],
1664+
key.attributes: [
1665+
{
1666+
key.offset: 2702,
1667+
key.length: 5,
1668+
key.attribute: source.decl.attribute.objc
1669+
}
1670+
],
1671+
key.elements: [
1672+
{
1673+
key.kind: source.lang.swift.structure.elem.typeref,
1674+
key.offset: 2729,
1675+
key.length: 16
1676+
}
1677+
],
1678+
key.substructure: [
1679+
{
1680+
key.kind: source.lang.swift.decl.var.instance,
1681+
key.accessibility: source.lang.swift.accessibility.internal,
1682+
key.name: "thing",
1683+
key.offset: 2752,
1684+
key.length: 25,
1685+
key.typename: "NSObject",
1686+
key.nameoffset: 2756,
1687+
key.namelength: 5,
1688+
key.bodyoffset: 2773,
1689+
key.bodylength: 3
1690+
}
1691+
]
16481692
}
16491693
],
16501694
key.diagnostics: [

Diff for: test/SourceKit/DocumentStructure/structure.swift.foobar.response

+45-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
key.offset: 0,
3-
key.length: 2689,
3+
key.length: 2787,
44
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
55
key.substructure: [
66
{
@@ -1645,6 +1645,50 @@
16451645
key.namelength: 5,
16461646
key.bodyoffset: 2675,
16471647
key.bodylength: 8
1648+
},
1649+
{
1650+
key.kind: source.lang.swift.decl.protocol,
1651+
key.accessibility: source.lang.swift.accessibility.internal,
1652+
key.name: "MyProtocol",
1653+
key.offset: 2708,
1654+
key.length: 71,
1655+
key.nameoffset: 2717,
1656+
key.namelength: 10,
1657+
key.bodyoffset: 2747,
1658+
key.bodylength: 31,
1659+
key.inheritedtypes: [
1660+
{
1661+
key.name: "NSObjectProtocol"
1662+
}
1663+
],
1664+
key.attributes: [
1665+
{
1666+
key.offset: 2702,
1667+
key.length: 5,
1668+
key.attribute: source.decl.attribute.objc
1669+
}
1670+
],
1671+
key.elements: [
1672+
{
1673+
key.kind: source.lang.swift.structure.elem.typeref,
1674+
key.offset: 2729,
1675+
key.length: 16
1676+
}
1677+
],
1678+
key.substructure: [
1679+
{
1680+
key.kind: source.lang.swift.decl.var.instance,
1681+
key.accessibility: source.lang.swift.accessibility.internal,
1682+
key.name: "thing",
1683+
key.offset: 2752,
1684+
key.length: 25,
1685+
key.typename: "NSObject",
1686+
key.nameoffset: 2756,
1687+
key.namelength: 5,
1688+
key.bodyoffset: 2773,
1689+
key.bodylength: 3
1690+
}
1691+
]
16481692
}
16491693
],
16501694
key.diagnostics: [

Diff for: test/SourceKit/DocumentStructure/structure.swift.response

+45-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
key.offset: 0,
3-
key.length: 2689,
3+
key.length: 2787,
44
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
55
key.substructure: [
66
{
@@ -1645,6 +1645,50 @@
16451645
key.namelength: 5,
16461646
key.bodyoffset: 2675,
16471647
key.bodylength: 8
1648+
},
1649+
{
1650+
key.kind: source.lang.swift.decl.protocol,
1651+
key.accessibility: source.lang.swift.accessibility.internal,
1652+
key.name: "MyProtocol",
1653+
key.offset: 2708,
1654+
key.length: 71,
1655+
key.nameoffset: 2717,
1656+
key.namelength: 10,
1657+
key.bodyoffset: 2747,
1658+
key.bodylength: 31,
1659+
key.inheritedtypes: [
1660+
{
1661+
key.name: "NSObjectProtocol"
1662+
}
1663+
],
1664+
key.attributes: [
1665+
{
1666+
key.offset: 2702,
1667+
key.length: 5,
1668+
key.attribute: source.decl.attribute.objc
1669+
}
1670+
],
1671+
key.elements: [
1672+
{
1673+
key.kind: source.lang.swift.structure.elem.typeref,
1674+
key.offset: 2729,
1675+
key.length: 16
1676+
}
1677+
],
1678+
key.substructure: [
1679+
{
1680+
key.kind: source.lang.swift.decl.var.instance,
1681+
key.accessibility: source.lang.swift.accessibility.internal,
1682+
key.name: "thing",
1683+
key.offset: 2752,
1684+
key.length: 25,
1685+
key.typename: "NSObject",
1686+
key.nameoffset: 2756,
1687+
key.namelength: 5,
1688+
key.bodyoffset: 2773,
1689+
key.bodylength: 3
1690+
}
1691+
]
16481692
}
16491693
],
16501694
key.diagnostics: [

0 commit comments

Comments
 (0)