Define post-fix arrays as determinate and pre-fix arrays as indeterminate.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
int[] gInvalid = {1};
|
||||
|
||||
public OnPluginStart()
|
||||
{
|
||||
int v = 10;
|
||||
int invalid1[v];
|
||||
int[] invalid2 = {1};
|
||||
}
|
||||
|
||||
void invalid_arg1(int invalid[])
|
||||
{
|
||||
}
|
||||
|
||||
void invalid_arg2(int[] invalid = {1, 2, 3})
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
(1) : error 162: cannot create dynamic arrays in global scope - did you mean to create a fixed-length array with brackets after the variable name?
|
||||
(6) : error 161: brackets after variable name indicate a fixed-size array, but a dynamic size was given - did you mean to use 'new int[size]' syntax?
|
||||
(7) : error 160: brackets in between type and variable name indicate a dynamic-size array, but a fixed-size initializer was given
|
||||
(10) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
|
||||
(14) : error 160: brackets in between type and variable name indicate a dynamic-size array, but a fixed-size initializer was given
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
native int[] egg6();
|
||||
forward float[] egg7();
|
||||
new void crab4;
|
||||
int[] yam1 = {1,2,3}, yam2[] = {3,4,5};
|
||||
|
||||
void bad(int[] yam[] = {1})
|
||||
{
|
||||
}
|
||||
|
||||
forward void OnPluginStart();
|
||||
|
||||
public int OnPluginStart()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(1) : error 141: natives, forwards, and public functions cannot return arrays
|
||||
(2) : error 141: natives, forwards, and public functions cannot return arrays
|
||||
(3) : error 143: new-style declarations should not have "new"
|
||||
(4) : error 121: cannot specify array dimensions on both type and name
|
||||
(6) : error 025: function heading differs from prototype
|
||||
(5) : error 121: cannot specify array dimensions on both type and name
|
||||
(9) : error 025: function heading differs from prototype
|
||||
|
||||
@@ -2,7 +2,7 @@ stock A(int n)
|
||||
{
|
||||
}
|
||||
|
||||
stock B(int n[])
|
||||
stock B(int n[10])
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,8 @@ new crab2 = 5;
|
||||
bool crab3 = true;
|
||||
int crab4 = 6;
|
||||
new crab5[] = {1, 2, 3};
|
||||
bool[] crab6 = {true, false, false, true}
|
||||
bool crab7[] = {false, true, true}
|
||||
char crab8[] = "hello"
|
||||
char[] crab9 = "bye"
|
||||
|
||||
native float operator*(float oper1, float oper2) = FloatMul;
|
||||
|
||||
@@ -41,7 +39,6 @@ new Float:ham, bool:ham2;
|
||||
int cram, cram2, cram3;
|
||||
new cram4[] = {1, 2}, cram5[] = {3, 4, 7}
|
||||
int cram6[] = {1, 2}, cram7[] = {3, 4, 7}
|
||||
int[] cram8 = {3, 4}, cram9 = {4, 8, 10}
|
||||
|
||||
public OnPluginStart()
|
||||
{
|
||||
@@ -50,6 +47,4 @@ public OnPluginStart()
|
||||
cram4[0] = 2
|
||||
cram5[2] = 2
|
||||
cram7[2] = 2
|
||||
cram8[1] = 5
|
||||
cram9[2] = 5
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user