Open joshi-monster opened 1 week ago
Thank you for figuring out how to replicate this one!
I found a better one that starts from a fresh project!! It's a little bit different, but it looks like it's the same problem to me.
Make a new gleam project with the following main module:
import gleam/io
import gleam/set
pub fn main() {
let s = set.from_list([1, 1, 2, 3])
use x <- set.each(s) // available only on the latest version
io.debug(x)
}
then run these commands:
gleam run # to have a build/ cache
# required because you can't `add` a specific version if it's already locked
gleam remove gleam_stdlib
gleam add gleam_stdlib@0.39.0
# first gleam run: shows the compile error
gleam run
# second gleam run: tries to run anyways
gleam run
the second gleam run
runs the program, but crashes with
runtime error: Erlang error
A function was called but it did not exist.
stacktrace:
gleam/set.each unknown source
~ :purple_heart:
Hero! Thank you!
I found a reproduction for a build directory caching problem using this repo.
Inside of the repository, running these commands:
produces:
removing the build directory again and rebuilding reveals another type error and gets rid of the errors above:
Just guessing here, but I think it has to do with the fact that type checking stops after finding that first nakai-related error, but the compiler then assumes this was the only dependency-related problem.
Gleam 1.5.1 ~ :purple_heart: