gleam-lang/gleam

Erlang target: "unbound variable" error when referencing a `const` record inside a case expression

Open

#5.261 aberto em 4 de jan. de 2026

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (960 forks)batch import
help wanted

Métricas do repositório

Stars
 (21.417 stars)
Métricas de merge de PR
 (Mesclagem média 10d 19h) (69 fundiu PRs em 30d)

Description

Referencing a const record inside a case expression causes a runtime crash in the Erlang target. This only seems to occur under a very specific set of conditions:

  • The case subject is a const record;
  • A case clause matches on a constructor of that record type;
  • The result branch (->) of that clause attempts to reference the same const.

In this scenario, the Erlang code generator mistakenly treats the reference to the const as a local variable that hasn't been defined, leading to an unbound variable error.

Reproduction

Gleam code: (Playground link)

pub type Wibble {
  Wibble
}

const wibble = Wibble

pub fn main() {
  case wibble {
    Wibble -> wibble
  }
}

Generated Erlang code:


-module(const_bug_reproducer).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/const_bug_reproducer.gleam").
-export([main/0]).
-export_type([wibble/0]).

-type wibble() :: wibble.

-file("src/const_bug_reproducer.gleam", 7).
-spec main() -> wibble().
main() ->
    case wibble of
        wibble ->
            Wibble
    end.

Runtime error:


Compiling const_bug_reproducer
src/const_bug_reproducer.gleam:12:13: variable 'Wibble' is unbound
error: Shell command failure

There was a problem when running the shell command `escript`.

Versions

  • Gleam: v1.14.0
  • OS: Linux Mint
  • Runtime: Erlang/OTP 28

Logs

GLEAM_LOG=trace gleam run
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam.lock"
TRACE download_deps: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/gleam.toml"
DEBUG download_deps: reading_manifest_toml
TRACE download_deps: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/manifest.toml"
TRACE download_deps: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/packages.toml"
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-dev-erlang.lock"
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-dev-javascript.lock"
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-prod-erlang.lock"
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-prod-javascript.lock"
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-lsp-erlang.lock"
DEBUG download_deps: locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-lsp-javascript.lock"
TRACE download_deps: writing_file path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/packages.toml"
TRACE reading_file path="/home/igor/Documents/projects/const_bug_reproducer/gleam.toml"
TRACE reading_file path="/home/igor/Documents/projects/const_bug_reproducer/gleam.toml"
TRACE reading_file path="/home/igor/Documents/projects/const_bug_reproducer/gleam.toml"
 INFO Compiling packages
DEBUG locking_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/gleam-dev-erlang.lock"
TRACE reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_version"
TRACE reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/gleam.toml"
TRACE compile{package=gleam_stdlib}:load: gleam_source_files "/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src"
TRACE compile{package=gleam_stdlib}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src"
TRACE compile{package=gleam_stdlib}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam/dynamic"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta"
TRACE compile{package=gleam_stdlib}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta"
TRACE compile{package=gleam_stdlib}: CacheFiles::modules_with_meta_files "/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts"
TRACE compile{package=gleam_stdlib}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/order
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/float
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/int
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/option
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/dict
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/list
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/string_tree
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/string
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/bit_array
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/bool
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/bytes_tree
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/dynamic
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/dynamic/decode
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/function
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/io
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/pair
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/result
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/set
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline"
DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/uri
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache"
TRACE compile{package=gleam_stdlib}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline"
 INFO compile{package=gleam_stdlib}: analysing_modules count=0
DEBUG compile{package=gleam_stdlib}: performing_code_generation
DEBUG compile{package=gleam_stdlib}: copying_native_source_files
TRACE compile{package=gleam_stdlib}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@bytes_tree.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@order.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@option.erl"
TRACE compile{package=gleam_stdlib}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@float.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@string.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@function.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@string_tree.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam_stdlib.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam_stdlib.mjs"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@list.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/dict.mjs"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@bool.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@pair.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@bit_array.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@int.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@result.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@dict.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@uri.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@set.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@dynamic.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@io.erl"
DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam@dynamic@decode.erl"
TRACE compile{package=gleam_stdlib}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleam_stdlib/src/gleam/dynamic"
DEBUG compile{package=gleam_stdlib}: skipping_entrypoint_generation
DEBUG compile{package=gleam_stdlib}: no_erlang_to_compile
TRACE compile{package=gleam_stdlib}: writing_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app"
TRACE reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/gleam.toml"
TRACE compile{package=gleeunit}:load: gleam_source_files "/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src"
TRACE compile{package=gleeunit}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src"
TRACE compile{package=gleeunit}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit"
TRACE compile{package=gleeunit}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache_meta"
TRACE compile{package=gleeunit}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta"
TRACE compile{package=gleeunit}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit/internal"
TRACE compile{package=gleeunit}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_meta"
TRACE compile{package=gleeunit}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_meta"
TRACE compile{package=gleeunit}: CacheFiles::modules_with_meta_files "/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts"
TRACE compile{package=gleeunit}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts"
TRACE compile{package=gleeunit}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit"
TRACE compile{package=gleeunit}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit/internal"
DEBUG compile{package=gleeunit}: module_to_load_from_cache module=gleeunit
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache"
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache_inline"
DEBUG compile{package=gleeunit}: module_to_load_from_cache module=gleeunit/internal/gleam_panic
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache"
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_inline"
DEBUG compile{package=gleeunit}: module_to_load_from_cache module=gleeunit/internal/reporting
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache"
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_inline"
DEBUG compile{package=gleeunit}: module_to_load_from_cache module=gleeunit/should
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache"
TRACE compile{package=gleeunit}: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache_inline"
 INFO compile{package=gleeunit}: analysing_modules count=0
DEBUG compile{package=gleeunit}: performing_code_generation
DEBUG compile{package=gleeunit}: copying_native_source_files
TRACE compile{package=gleeunit}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit.erl"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit_progress.erl"
TRACE compile{package=gleeunit}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit@should.erl"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit@internal@gleam_panic.erl"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit@internal@reporting.erl"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit_ffi.erl"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit_ffi.mjs"
TRACE compile{package=gleeunit}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit/internal"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.erl"
DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/home/igor/Documents/projects/const_bug_reproducer/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs"
DEBUG compile{package=gleeunit}: skipping_entrypoint_generation
DEBUG compile{package=gleeunit}: no_erlang_to_compile
TRACE compile{package=gleeunit}: writing_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/gleeunit/ebin/gleeunit.app"
TRACE compile{package=const_bug_reproducer}:load: gleam_source_files "/home/igor/Documents/projects/const_bug_reproducer/src"
TRACE compile{package=const_bug_reproducer}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/src"
TRACE compile{package=const_bug_reproducer}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/src/const_bug_reproducer.gleam"
TRACE compile{package=const_bug_reproducer}:load: gleam_source_files "/home/igor/Documents/projects/const_bug_reproducer/test"
TRACE compile{package=const_bug_reproducer}:load: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/test"
TRACE compile{package=const_bug_reproducer}:load: reading_file path="/home/igor/Documents/projects/const_bug_reproducer/test/const_bug_reproducer_test.gleam"
TRACE compile{package=const_bug_reproducer}:load: gleam_source_files "/home/igor/Documents/projects/const_bug_reproducer/dev"
TRACE compile{package=const_bug_reproducer}: CacheFiles::modules_with_meta_files "/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts"
TRACE compile{package=const_bug_reproducer}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts"
DEBUG compile{package=const_bug_reproducer}: new_module_to_be_compiled module=const_bug_reproducer
DEBUG compile{package=const_bug_reproducer}: new_module_to_be_compiled module=const_bug_reproducer_test
  Compiling const_bug_reproducer
 INFO compile{package=const_bug_reproducer}: analysing_modules count=2
DEBUG compile{package=const_bug_reproducer}: Type checking module="const_bug_reproducer"
DEBUG compile{package=const_bug_reproducer}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG compile{package=const_bug_reproducer}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG compile{package=const_bug_reproducer}: Type checking module="const_bug_reproducer_test"
DEBUG compile{package=const_bug_reproducer}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG compile{package=const_bug_reproducer}: performing_code_generation
DEBUG compile{package=const_bug_reproducer}: copying_native_source_files
TRACE compile{package=const_bug_reproducer}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/src"
TRACE compile{package=const_bug_reproducer}: reading_directory path="/home/igor/Documents/projects/const_bug_reproducer/test"
DEBUG compile{package=const_bug_reproducer}: erlang_entrypoint_already_exists
DEBUG compile{package=const_bug_reproducer}: Generated Erlang module name="const_bug_reproducer.erl"
TRACE compile{package=const_bug_reproducer}: writing_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer.erl"
DEBUG compile{package=const_bug_reproducer}: Generated Erlang module name="const_bug_reproducer_test.erl"
TRACE compile{package=const_bug_reproducer}: writing_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer_test.erl"
DEBUG compile{package=const_bug_reproducer}: compiling_erlang
TRACE compile{package=const_bug_reproducer}: writing_file path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/gleam@@compile.erl"
TRACE compile{package=const_bug_reproducer}: spawn_beam_compiler escript_path="/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/gleam@@compile.erl"
DEBUG compile{package=const_bug_reproducer}: call_beam_compiler args="{\"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang\", \"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/ebin\", [\"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer_test.erl\", \"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer.erl\"]}"
{compiling,"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer_test.erl"}
{compiling,"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer.erl"}
src/const_bug_reproducer.gleam:12:13: variable 'Wibble' is unbound
{failed,"/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/_gleam_artefacts/const_bug_reproducer.erl"}
{compiled,const_bug_reproducer_test,
          "/home/igor/Documents/projects/const_bug_reproducer/build/dev/erlang/const_bug_reproducer/ebin/const_bug_reproducer_test.beam"}
ERROR Failed error=ShellCommand { program: "escript", reason: Unknown }
error: Shell command failure

There was a problem when running the shell command `escript`.

Guia do colaborador