Closed CrowdHailer closed 3 weeks ago
Could you give more detail on this please? This does not compile on JS, but I get a compile bug on Erlang, but neither is the issue you've described?
https://vimeo.com/965940552/86b69701a5?share=copy
Walk through of the issue hopefully gives more context Along with the smaller repro
import gleam/io
import gleam/bit_array
import gleam/list
fn underline(code) {
let code = bit_array.from_string(code)
let pre = 2
case code {
<<pre:bytes-size(pre), remaining:bytes>> -> {
#(pre, remaining)
}
_ -> panic
}
}
pub fn main() {
io.debug("hhello!")
underline("hello")
|> io.debug
}
Thank you 💜
FYI looks like this might be something specific to running the example in the tour. If you try to run this code in node/on local then you properly get a compile error
Oh spooky! What's going on there
I have extracted this reproduction from my project but not yet managed to reduce the function much. The following can be copied in the tour code playground an it breaks as follows.
Type checking passes, but the underline function is no in scope at runtime.
You can check that this is weird by replacing main with.