Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
int64_t value_int = -1;
if( !ASRUtils::extract_value(ASRUtils::expr_value(value), value_int) &&
contains_local_variable(value) && !is_allocatable) {
throw SemanticError("Only those local variables which can be reduced to compile "
"time constant should be used in dimensions of an array.",
throw SemanticError("Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array.",
value->base.loc);
}
if (value_int != -1) {
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-arrays_09-50ee586.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"stdout": null,
"stdout_hash": null,
"stderr": "asr-arrays_09-50ee586.stderr",
"stderr_hash": "30bfc87e70c4b4688cf7162eec34dce8e52c959539d20ad8b79cf845",
"stderr_hash": "0169175ca66ace6110382408ed4506313e311d560e9b8c16bdd997b3",
"returncode": 2
}
2 changes: 1 addition & 1 deletion tests/reference/asr-arrays_09-50ee586.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array.
semantic error: Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array.
--> tests/errors/arrays_09.py:9:12
|
9 | x: i64[p, q, r] = empty([q, p, r], dtype=int64)
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-arrays_10-bc82d75.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"stdout": null,
"stdout_hash": null,
"stderr": "asr-arrays_10-bc82d75.stderr",
"stderr_hash": "59e8cc91d7dae61bf60ec4d9cd23d62cdcb162e553bd64a3995fad19",
"stderr_hash": "1c45f4b45b48ceb3de4567413bff847b67df2750fcc68d6a358df096",
"returncode": 2
}
2 changes: 1 addition & 1 deletion tests/reference/asr-arrays_10-bc82d75.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array.
semantic error: Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array.
--> tests/errors/arrays_10.py:9:36
|
9 | x: i64[100, 120, 200] = empty([q, p, r], dtype=int64)
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-bindc_04-06bd800.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"stdout": null,
"stdout_hash": null,
"stderr": "asr-bindc_04-06bd800.stderr",
"stderr_hash": "20c105d0189cd06a197a6b1dda073a58f5c8ee0104230cf187960c46",
"stderr_hash": "85d50c491c17976f21e6263e164a6ce5dbeda95dae2635f589a02d86",
"returncode": 2
}
2 changes: 1 addition & 1 deletion tests/reference/asr-bindc_04-06bd800.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array.
semantic error: Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array.
--> tests/errors/bindc_04.py:20:12
|
20 | C: i16[nk] = empty(nk, dtype=int16)
Expand Down