Skip to content

Panic: "local compute kind does not exist" when interpreter has unbound names in Adaptive/Base #2689

@minestarks

Description

@minestarks

Repro in Python:

import qsharp
qsharp.init(target_profile=qsharp.TargetProfile.Base)
qsharp.eval("let y = x;")

Expected: Qsc.Resolve.NotFound (so far this is OK)

in a separate REPL / notebook line:

qsharp.eval("y")

PANIC

thread '<unnamed>' panicked at source/compiler/qsc_rca/src/applications.rs:610:14:
local compute kind does not exist

If the same code is run in the Unrestricted profile, you'll get an expected runtime error:

module.QSharpError: Qsc.Eval.UnboundName

  × runtime error
  ╰─▶ name is not bound
   ╭─[line_1:1:1]
 1 │ y
   · ─
   ╰────

We dodge this panic when we're in unrestricted, because we don't run FIR passes when we're in unrestricted.

Repros in qsharp 1.20.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions