Skip to content

Commit 0d46605

Browse files
committed
Add test cases of void/never in parameter types
1 parent c940402 commit 0d46605

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
// These are fatal compile errors, not parse errors
3+
function u(never $g, void $u) {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"SourceFileNode": {
3+
"statementList": [
4+
{
5+
"InlineHtml": {
6+
"scriptSectionEndTag": null,
7+
"text": null,
8+
"scriptSectionStartTag": {
9+
"kind": "ScriptSectionStartTag",
10+
"textLength": 6
11+
}
12+
}
13+
},
14+
{
15+
"FunctionDeclaration": {
16+
"attributes": null,
17+
"functionKeyword": {
18+
"kind": "FunctionKeyword",
19+
"textLength": 8
20+
},
21+
"byRefToken": null,
22+
"name": {
23+
"kind": "Name",
24+
"textLength": 1
25+
},
26+
"openParen": {
27+
"kind": "OpenParenToken",
28+
"textLength": 1
29+
},
30+
"parameters": {
31+
"ParameterDeclarationList": {
32+
"children": [
33+
{
34+
"Parameter": {
35+
"attributes": null,
36+
"visibilityToken": null,
37+
"modifiers": null,
38+
"questionToken": null,
39+
"typeDeclarationList": {
40+
"QualifiedNameList": {
41+
"children": [
42+
{
43+
"kind": "NeverReservedWord",
44+
"textLength": 5
45+
}
46+
]
47+
}
48+
},
49+
"byRefToken": null,
50+
"dotDotDotToken": null,
51+
"variableName": {
52+
"kind": "VariableName",
53+
"textLength": 2
54+
},
55+
"equalsToken": null,
56+
"default": null
57+
}
58+
},
59+
{
60+
"kind": "CommaToken",
61+
"textLength": 1
62+
},
63+
{
64+
"Parameter": {
65+
"attributes": null,
66+
"visibilityToken": null,
67+
"modifiers": null,
68+
"questionToken": null,
69+
"typeDeclarationList": {
70+
"QualifiedNameList": {
71+
"children": [
72+
{
73+
"kind": "VoidReservedWord",
74+
"textLength": 4
75+
}
76+
]
77+
}
78+
},
79+
"byRefToken": null,
80+
"dotDotDotToken": null,
81+
"variableName": {
82+
"kind": "VariableName",
83+
"textLength": 2
84+
},
85+
"equalsToken": null,
86+
"default": null
87+
}
88+
}
89+
]
90+
}
91+
},
92+
"closeParen": {
93+
"kind": "CloseParenToken",
94+
"textLength": 1
95+
},
96+
"colonToken": null,
97+
"questionToken": null,
98+
"returnTypeList": null,
99+
"compoundStatementOrSemicolon": {
100+
"CompoundStatementNode": {
101+
"openBrace": {
102+
"kind": "OpenBraceToken",
103+
"textLength": 1
104+
},
105+
"statements": [],
106+
"closeBrace": {
107+
"kind": "CloseBraceToken",
108+
"textLength": 1
109+
}
110+
}
111+
}
112+
}
113+
}
114+
],
115+
"endOfFileToken": {
116+
"kind": "EndOfFileToken",
117+
"textLength": 0
118+
}
119+
}
120+
}

0 commit comments

Comments
 (0)