@@ -2109,7 +2109,7 @@ BOOST_AUTO_TEST_CASE(array_with_nonconstant_length)
2109
2109
function f(uint a) public { uint8[a] x; }
2110
2110
}
2111
2111
)" ;
2112
- CHECK_ERROR (text, TypeError, " Identifier must be declared constant." );
2112
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
2113
2113
}
2114
2114
2115
2115
BOOST_AUTO_TEST_CASE (array_with_negative_length)
@@ -4398,7 +4398,7 @@ BOOST_AUTO_TEST_CASE(invalid_array_declaration_with_signed_fixed_type)
4398
4398
}
4399
4399
}
4400
4400
)" ;
4401
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
4401
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
4402
4402
}
4403
4403
4404
4404
BOOST_AUTO_TEST_CASE (invalid_array_declaration_with_unsigned_fixed_type)
@@ -4410,7 +4410,7 @@ BOOST_AUTO_TEST_CASE(invalid_array_declaration_with_unsigned_fixed_type)
4410
4410
}
4411
4411
}
4412
4412
)" ;
4413
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
4413
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
4414
4414
}
4415
4415
4416
4416
BOOST_AUTO_TEST_CASE (rational_to_bytes_implicit_conversion)
@@ -7254,7 +7254,7 @@ BOOST_AUTO_TEST_CASE(array_length_too_large)
7254
7254
uint[8**90] ids;
7255
7255
}
7256
7256
)" ;
7257
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
7257
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7258
7258
}
7259
7259
7260
7260
BOOST_AUTO_TEST_CASE (array_length_not_convertible_to_integer)
@@ -7264,7 +7264,7 @@ BOOST_AUTO_TEST_CASE(array_length_not_convertible_to_integer)
7264
7264
uint[true] ids;
7265
7265
}
7266
7266
)" ;
7267
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
7267
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7268
7268
}
7269
7269
7270
7270
BOOST_AUTO_TEST_CASE (array_length_constant_var)
@@ -7286,7 +7286,7 @@ BOOST_AUTO_TEST_CASE(array_length_non_integer_constant_var)
7286
7286
uint[LEN] ids;
7287
7287
}
7288
7288
)" ;
7289
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
7289
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7290
7290
}
7291
7291
7292
7292
BOOST_AUTO_TEST_CASE (array_length_cannot_be_function)
@@ -7297,7 +7297,7 @@ BOOST_AUTO_TEST_CASE(array_length_cannot_be_function)
7297
7297
uint[f] ids;
7298
7298
}
7299
7299
)" ;
7300
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
7300
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7301
7301
}
7302
7302
7303
7303
BOOST_AUTO_TEST_CASE (array_length_can_be_recursive_constant)
@@ -7321,7 +7321,7 @@ BOOST_AUTO_TEST_CASE(array_length_cannot_be_function_call)
7321
7321
uint[LEN] ids;
7322
7322
}
7323
7323
)" ;
7324
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
7324
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7325
7325
}
7326
7326
7327
7327
BOOST_AUTO_TEST_CASE (array_length_const_cannot_be_fractional)
@@ -7370,7 +7370,7 @@ BOOST_AUTO_TEST_CASE(array_length_cannot_be_constant_function_parameter)
7370
7370
}
7371
7371
}
7372
7372
)" ;
7373
- CHECK_ERROR (text, TypeError, " Constant identifier declaration must have a constant value ." );
7373
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7374
7374
}
7375
7375
7376
7376
BOOST_AUTO_TEST_CASE (array_length_with_cyclic_constant)
@@ -7409,7 +7409,7 @@ BOOST_AUTO_TEST_CASE(array_length_with_pure_functions)
7409
7409
uint[LEN] ids;
7410
7410
}
7411
7411
)" ;
7412
- CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal." );
7412
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7413
7413
}
7414
7414
7415
7415
BOOST_AUTO_TEST_CASE (array_length_invalid_expression)
@@ -7419,25 +7419,25 @@ BOOST_AUTO_TEST_CASE(array_length_invalid_expression)
7419
7419
uint[-true] ids;
7420
7420
}
7421
7421
)" ;
7422
- CHECK_ERROR (text, TypeError, " Invalid constant expression." );
7422
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression." );
7423
7423
text = R"(
7424
7424
contract C {
7425
7425
uint[true/1] ids;
7426
7426
}
7427
7427
)" ;
7428
- CHECK_ERROR (text, TypeError, " Invalid constant expression." );
7428
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression." );
7429
7429
text = R"(
7430
7430
contract C {
7431
7431
uint[1/true] ids;
7432
7432
}
7433
7433
)" ;
7434
- CHECK_ERROR (text, TypeError, " Invalid constant expression." );
7434
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression." );
7435
7435
text = R"(
7436
7436
contract C {
7437
7437
uint[1.111111E1111111111111] ids;
7438
7438
}
7439
7439
)" ;
7440
- CHECK_ERROR (text, TypeError, " Invalid literal value ." );
7440
+ CHECK_ERROR (text, TypeError, " Invalid array length, expected integer literal or constant expression ." );
7441
7441
text = R"(
7442
7442
contract C {
7443
7443
uint[3/0] ids;
0 commit comments