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
2 changes: 2 additions & 0 deletions src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ namespace Ark::internal
buildAndThrowError(fmt::format("Can not use {} with less than 2 arguments", name), head);
if (std::cmp_greater(argc, MaxValue16Bits))
buildAndThrowError(fmt::format("Too many arguments ({}), exceeds {}", argc, MaxValue16Bits), x);
if (argc != 2 && (inst == POP_LIST || inst == POP_LIST_IN_PLACE))
buildAndThrowError(fmt::format("Expected 2 arguments (list, index) for {}, got {}", name, argc), head);
if (argc != 3 && inst == SET_AT_INDEX)
buildAndThrowError(fmt::format("Expected 3 arguments (list, index, value) for {}, got {}", name, argc), head);
if (argc != 4 && inst == SET_AT_2_INDEX)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(mut a [0 1 2 3])
(pop! a 0 1 2 3)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
In file tests/unittests/resources/DiagnosticsSuite/compileTime/pop_list_in_place_too_many_args.ark:2
1 | (mut a [0 1 2 3])
2 | (pop! a 0 1 2 3)
| ^~~~
3 |
Expected 2 arguments (list, index) for pop!, got 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(mut a [0 1 2 3])
(pop a 0 1 2 3)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
In file tests/unittests/resources/DiagnosticsSuite/compileTime/pop_list_too_many_args.ark:2
1 | (mut a [0 1 2 3])
2 | (pop a 0 1 2 3)
| ^~~
3 |
Expected 2 arguments (list, index) for pop, got 5
Loading