Skip to content

Language service panic for fail in loop #3461

Description

@amcasey

Describe the bug

@EntryPoint(Adaptive)
operation Main() : Int {
    repeat {
        fail "hello"
    } until 1 < 2
}
[wasm] Wasm panic occurred: panicked at source/compiler/qsc_fir_transforms/src/invariants.rs:707:5:
Non-Unit block-tail invariant violation: callable 'Main' body Block 0 has type Prim(Int) but trailing Expr 3 has type Tuple([])
[wasm] Wasm panic occurred: panicked at source/language_service/src/lib.rs:309:44:
RefCell already mutably borrowed

To Reproduce

Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions