Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Error: Invalid Argument "Value.as_tup" #3497

Closed
q-uint opened this issue Oct 18, 2022 · 2 comments · Fixed by #3967
Closed

Internal Error: Invalid Argument "Value.as_tup" #3497

q-uint opened this issue Oct 18, 2022 · 2 comments · Fixed by #3967
Assignees
Labels
P1 high priority, resolve before the next milestone

Comments

@q-uint
Copy link

q-uint commented Oct 18, 2022

It seems like the interpreter (moc -r) does not like the following... (moc v0.7.0)

import { debugPrint } = "mo:⛔";

let t = [var (0x00, 0x00)];

for ((k, v) in t.vals()) {
    debugPrint(debug_show(k, v));
}

Error Stack Trace

test/oops.mo:5.16-5.24: internal error, Invalid_argument("Value.as_tup")
Last environment:
@ManagementCanister = {}
@add_cycles = func
@blob_size = func
@blob_vals = func
@call_raw = func
@create_actor_helper = func
@cycles = 0
@digits_dec = func
@digits_hex = func
@equal_array = func
@getSystemRefund = func
@ic00 = ""
@ic00_create_canister = func
@ic00_install_code = func
@immut_array_get = func
@immut_array_keys = func
@immut_array_size = func
@immut_array_vals = func
@int16ToInt = func
@int32ToInt = func
@int64ToInt = func
@int8ToInt = func
@left_pad = func
@mut_array_get = func
@mut_array_keys = func
@mut_array_put = func
@mut_array_size = func
@mut_array_vals = func
@nat16ToNat = func
@nat32ToNat = func
@nat64ToNat = func
@nat8ToNat = func
@new_async = func
@refund = 0
@reset_cycles = func
@reset_refund = func
@text_chars = func
@text_has_parens = func
@text_needs_parens = func
@text_of_Blob = func
@text_of_Bool = func
@text_of_Char = func
@text_of_Float = func
@text_of_Int = func
@text_of_Int16 = func
@text_of_Int32 = func
@text_of_Int64 = func
@text_of_Int8 = func
@text_of_Nat = func
@text_of_Nat16 = func
@text_of_Nat32 = func
@text_of_Nat64 = func
@text_of_Nat8 = func
@text_of_Text = func
@text_of_array = func
@text_of_array_mut = func
@text_of_num = func
@text_of_option = func
@text_of_variant = func
@text_size = func
debugPrint = func
t = [(0, 0)]

Raised at Mo_values__Value.invalid in file "mo_values/value.ml", line 76, characters 16-55
Called from Mo_interpreter__Interpret.match_pat in file "mo_interpreter/interpret.ml", line 776, characters 20-32
Called from Mo_interpreter__Interpret.interpret_exp_mut.(fun).k_continue.(fun) in file "mo_interpreter/interpret.ml", line 589, characters 19-35
Called from Mo_interpreter__Interpret.Scheduler.yield in file "mo_interpreter/interpret.ml", line 118, characters 8-23
Called from Mo_interpreter__Interpret.Scheduler.run in file "mo_interpreter/interpret.ml", line 121, characters 36-44
Called from Mo_interpreter__Interpret.interpret_prog in file "mo_interpreter/interpret.ml", line 964, characters 4-20
@crusso
Copy link
Contributor

crusso commented Oct 24, 2022

Thanks for reporting!
Hopefully this is only an interpreter issue. The playground compiler seems to be ok with something similar:
https://m7sm4-2iaaa-aaaab-qabra-cai.raw.ic0.app/?tag=354875995

@crusso crusso self-assigned this Oct 24, 2022
@crusso crusso added the P1 high priority, resolve before the next milestone label Oct 24, 2022
@crusso
Copy link
Contributor

crusso commented May 6, 2023

Fixed in #3967 @q-uint

@mergify mergify bot closed this as completed in #3967 May 6, 2023
mergify bot pushed a commit that referenced this issue May 6, 2023
…ments of mutable arrays (#3967)

Fixes #3497.

God save the King!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 high priority, resolve before the next milestone
Projects
None yet
2 participants