thread '<unnamed>' panicked at 'called Option::unwrap() on a None value', nac3core/src/typecheck/type_inferencer/mod.rs:812:75 #199

Closed
opened 2022-02-25 21:19:19 +08:00 by sb10q · 4 comments
Owner

Patch ARTIQ nac3 branch with the attached patch.

> artiq_compile nac3devices.py 
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', nac3core/src/typecheck/type_inferencer/mod.rs:812:75
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/nix/store/zgzg17559z7dnhqvacnzkc8nkia21zvc-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
pyo3_runtime.PanicException: called `Option::unwrap()` on a `None` value
Patch ARTIQ nac3 branch with the attached patch. ``` > artiq_compile nac3devices.py thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', nac3core/src/typecheck/type_inferencer/mod.rs:812:75 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Traceback (most recent call last): File "/nix/store/zgzg17559z7dnhqvacnzkc8nkia21zvc-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) pyo3_runtime.PanicException: called `Option::unwrap()` on a `None` value ```
sb10q added the
high-priority
label 2022-02-25 21:19:19 +08:00
Author
Owner

This occurs when calling a kernel (from another kernel) and passing keyword arguments.

e.g.

@kernel
def foo(x: int32):
  pass
  
@kernel
def bar():
  foo(x=1)

This occurs when calling a kernel (from another kernel) and passing keyword arguments. e.g. ```python @kernel def foo(x: int32): pass @kernel def bar(): foo(x=1) ```
Contributor

Fixed.

Fixed.
Author
Owner

Could you add some unit tests?

Could you add some unit tests?
Contributor

Yes but maybe later.

Yes but maybe later.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#199
No description provided.