You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% roc dev
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread 'main' panicked at 'region @17-49 not in list of dbgs', /Users/m1ci/actions-runner2/_work/roc/roc/crates/repl_expect/src/run.rs:521:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Device info
M1 pro chip running macOS 14.0
roc nightly pre-release, built from commit 849296a on Wed Nov 1 09:19:44 UTC 2023
Reproduction
The problem is caused by the dbg call on line 23 of the following code snippet, which I modified from the tutorial. I ran the code using roc dev.
## This is a comment for documentation, and includes a code block.
##
## x = 2
## expect x == 2
app "hello"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.5.0/Cufzl36_SnJ4QbOoEmiJ5dIpUxBvdB3NEySvuH82Wio.tar.br" }
imports [pf.Stdout]
provides [main] to pf
birds = 3
iguanas = -2
total = birds + iguanas
isAre = pluralize "is" "are" total
animalS = pluralize "animal" "animals" total
totalCount = stringify total
pluralize = \singular, plural, count ->
dbg Pluralize "'count' is: \(Num.toStr count)"
if count == 1 then
singular
else
plural
stringify = \num ->
if num == 0 then
"no"
else if num < 0 then
"negative"
else
Num.toStr num
main =
Stdout.line "There \(isAre) \(totalCount) \(animalS).\n\(Num.toStr birds) birds and \(Num.toStr iguanas) iguanas."
The text was updated successfully, but these errors were encountered:
Thank you for logging this issue @yasuiniko. I assume you figured out that if you remove the tag then it works correctly?
dbg can only accept 1 argument. Roc should provide a helpful error message. I suspect that #5775 will resolve this issue as this will be a function call and provide a helpful error message.
Below is a smaller repro.
roc dev broken.roc
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread 'main' panicked at 'region @17-9 not in list of dbgs', /Users/luke/Documents/GitHub/roc/crates/repl_expect/src/run.rs:521:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error message
Device info
Reproduction
The problem is caused by the
dbg
call on line 23 of the following code snippet, which I modified from the tutorial. I ran the code usingroc dev
.The text was updated successfully, but these errors were encountered: