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

Inspect recursive tag unions triggers a panic in the compiler #7160

Open
konnik opened this issue Oct 12, 2024 · 0 comments
Open

Inspect recursive tag unions triggers a panic in the compiler #7160

konnik opened this issue Oct 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@konnik
Copy link

konnik commented Oct 12, 2024

This program triggers a panic in the compiler.

$ roc --version
roc nightly pre-release, built from commit bf5b13e237f on Wed Oct  9 09:13:56 UTC 2024

Panic.roc:

app [main] {
    pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br",
}

import pf.Stdout

main =
    # Note: if the type annotation below is removed the compiler won't panic any more
    x : X
    x = A
    _ = Inspect.toStr x
    Stdout.line "Nope"

X : [
    A,
    B (List X),
    C (List (Str, X)),
]

Error:

$ roc build Panic.roc 
thread 'main' panicked at crates/compiler/mono/src/borrow.rs:396:34:
internal error: entered unreachable code: 
	No borrow signature for LambdaName { name: `2.IdentId(18)`, niche: Niche(Captures([InLayout(245)])) } layout.

	Tip 1: This can happen when you call a function with less arguments than it expects.
	Like `Arg.list!` instead of `Arg.list! {}`.
	Tip 2: `roc check yourfile.roc` can sometimes give you a helpful error. 
                            
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@lukewilliamboswell lukewilliamboswell added the bug Something isn't working label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants