Open storyfeet opened 1 year ago
Thanks for the report! Could you share the whole program this came from? I am seeing the following trace when I try to reproduce:
❯ target/release/roc dev examples/helloWorld.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 '<unnamed>' panicked at 'no lambda set found for (`21.IdentId(27)`, [
InLayout(
21,
),
InLayout(
62,
),
]): LambdaSet {
set: [
( 21.27, [InLayout(21), InLayout(35)]),
( 21.32, [InLayout(1)]),
],
args: [
InLayout(
1,
),
],
ret: InLayout(
1,
),
representation: InLayout(
36,
),
full_layout: InLayout(
37,
),
}', crates/compiler/mono/src/layout.rs:1500:17
(the is an addition of InLayout(62)
)
I believe this to be related to https://github.com/roc-lang/roc/issues/4905
This is the whole file
app "hello"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
imports [pf.Stdout, pf.Stdin, pf.Task.{await}]
provides [main] to pf
iguanas : U64
iguanas = 2
main =
_ <- await (Stdout.line "How many birds")
birdCount <- await Stdin.line
bn = when Str.toU64 birdCount is
Err _ -> 0
Ok b -> b
total = Num.toStr ( bn + iguanas)
_ <- await (Stdout.line "There are \(total) animals")
main
Anyhow, while I'd appreciate help making a looping await.
I think Task.loop
may be useful for your case @storyfeet, you can see an example here.
Unfortunately, this is blocked on #5223.
I'm trying to work out how to run a looping await in Roc, (I'm very new to this)
So I tried to put "main" as the callback (I probably did it wrong)
Anyhow, while I'd appreciate help making a looping await. I'm posting this because the compiler asked me to nicely.
I got the following message:
The backtrace looked like this: