gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.43k stars 723 forks source link

Certain identifiers named `Maybe` generate invalid Erlang code on Erlang/OTP 27 #3233

Closed barszcz closed 3 months ago

barszcz commented 3 months ago

Gleam version: 1.2.1 OS: macOS Monterey (12.4) Runtime: BEAM (Erlang/OTP 27)

As of Erlang/OTP 27, maybe is now a reserved word. This means that some (but not all) generated Erlang code attempting to use maybe as an identifier no longer compiles. Some example code follows:

import gleam/io

// custom type named Maybe doesn't compile
pub type Maybe {
  // variant named Maybe doesn't compile
  Maybe
}

// module level function named maybe doesn't compile
pub fn maybe() {
  io.println("oops")
  "oops"
}

// module level const named maybe compiles
const maybe = "here's my number, so call me maybe"

pub fn main() {
  // local variable binding named maybe compiles
  let maybe = "here's my number, so call me maybe"
  io.println(maybe)
}

As I mentioned in the Gleam Discord, I discovered this while working through the Exercism track – the "Valentine's Day" exercise asks you to create a custom type variant named Maybe so newcomers to Gleam are especially likely to get bitten by this. Here's a trace:

long log ``` DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/packages" TRACE download_deps: reading_file path="/Users/jake/dev/maybe_bug_example/gleam.toml" DEBUG download_deps: reading_manifest_toml TRACE download_deps: reading_file path="/Users/jake/dev/maybe_bug_example/manifest.toml" DEBUG download_deps: manifest_up_to_date TRACE download_deps: reading_file path="/Users/jake/dev/maybe_bug_example/build/packages/packages.toml" DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/dev/erlang" DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/dev/javascript" DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/prod/erlang" DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/prod/javascript" DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/lsp/erlang" DEBUG download_deps: locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/lsp/javascript" TRACE download_deps: writing_file path="/Users/jake/dev/maybe_bug_example/build/packages/packages.toml" TRACE reading_file path="/Users/jake/dev/maybe_bug_example/gleam.toml" TRACE reading_file path="/Users/jake/dev/maybe_bug_example/gleam.toml" TRACE reading_file path="/Users/jake/dev/maybe_bug_example/gleam.toml" INFO Compiling packages DEBUG locking_build_directory path="/Users/jake/dev/maybe_bug_example/build/dev/erlang" TRACE reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_version" TRACE reading_file path="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/gleam.toml" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_builder.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta" TRACE compile{package=gleam_stdlib}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/order TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/float TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/int TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/option TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/dict TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/pair TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/list TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/result TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/iterator TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/string_builder TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/string TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/bit_array TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/bool TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/bytes_builder TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_builder.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/dynamic TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/function TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/io TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/queue TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/regex TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/set TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache" DEBUG compile{package=gleam_stdlib}: module_to_load_from_cache module=gleam/uri TRACE compile{package=gleam_stdlib}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache" 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="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@list.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@float.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@queue.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/dict.mjs" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@iterator.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@io.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@dynamic.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@string_builder.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@bool.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@bit_array.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@option.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@result.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@pair.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@order.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@regex.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@function.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@int.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@uri.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@bytes_builder.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@set.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@string.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam@dict.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam_stdlib.erl" DEBUG compile{package=gleam_stdlib}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleam_stdlib/src/gleam_stdlib.mjs" TRACE compile{package=gleam_stdlib}: writing_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app" DEBUG compile{package=gleam_stdlib}: skipping_entrypoint_generation DEBUG compile{package=gleam_stdlib}: no_erlang_to_compile TRACE reading_file path="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/gleam.toml" TRACE compile{package=gleeunit}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta" TRACE compile{package=gleeunit}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache_meta" DEBUG compile{package=gleeunit}: module_to_load_from_cache module=gleeunit TRACE compile{package=gleeunit}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache" DEBUG compile{package=gleeunit}: module_to_load_from_cache module=gleeunit/should TRACE compile{package=gleeunit}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache" 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="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/src" DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/src/gleeunit_ffi.mjs" DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/src/gleeunit_ffi.erl" DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/src/gleeunit_progress.erl" DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/src/gleeunit@should.erl" DEBUG compile{package=gleeunit}: skipping_unchanged_native_file_unchanged file="/Users/jake/dev/maybe_bug_example/build/packages/gleeunit/src/gleeunit.erl" TRACE compile{package=gleeunit}: writing_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/gleeunit/ebin/gleeunit.app" DEBUG compile{package=gleeunit}: skipping_entrypoint_generation DEBUG compile{package=gleeunit}: no_erlang_to_compile TRACE compile{package=maybe_bug_example}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.cache_meta" TRACE compile{package=maybe_bug_example}:load: reading_file path="/Users/jake/dev/maybe_bug_example/src/maybe_bug_example.gleam" DEBUG compile{package=maybe_bug_example}:load: cache_stale name="maybe_bug_example" TRACE compile{package=maybe_bug_example}:load: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example_test.cache_meta" DEBUG compile{package=maybe_bug_example}: module_to_be_compiled module=maybe_bug_example DEBUG compile{package=maybe_bug_example}: module_to_load_from_cache module=maybe_bug_example_test TRACE compile{package=maybe_bug_example}: reading_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example_test.cache" Compiling maybe_bug_example INFO compile{package=maybe_bug_example}: analysing_modules count=1 DEBUG compile{package=maybe_bug_example}: Type checking module="maybe_bug_example" DEBUG compile{package=maybe_bug_example}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes DEBUG compile{package=maybe_bug_example}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes DEBUG compile{package=maybe_bug_example}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes DEBUG compile{package=maybe_bug_example}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes DEBUG compile{package=maybe_bug_example}: built glob set; 1 literals, 0 basenames, 0 extensions, 1 prefixes, 0 suffixes, 0 required extensions, 0 regexes DEBUG compile{package=maybe_bug_example}: performing_code_generation DEBUG compile{package=maybe_bug_example}: copying_native_source_files TRACE compile{package=maybe_bug_example}: reading_directory path="/Users/jake/dev/maybe_bug_example/src" TRACE compile{package=maybe_bug_example}: reading_directory path="/Users/jake/dev/maybe_bug_example/test" TRACE compile{package=maybe_bug_example}: writing_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/ebin/maybe_bug_example.app" DEBUG compile{package=maybe_bug_example}: erlang_entrypoint_already_exists DEBUG compile{package=maybe_bug_example}: Generated Erlang module name="maybe_bug_example.erl" TRACE compile{package=maybe_bug_example}: writing_file path="/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl" DEBUG compile{package=maybe_bug_example}: compiling_erlang TRACE compile{package=maybe_bug_example}: command_exec program="escript" args="/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/gleam@@compile.erl --lib /Users/jake/dev/maybe_bug_example/build/dev/erlang --out /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/ebin /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl" env=[] cwd=None {compiling,"/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl"} /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:4:15: syntax error before: '/' % 4| -export([maybe/0, main/0]). % | ^ /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:5:20: syntax error before: '/' % 5| -export_type([maybe/0]). % | ^ /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:7:13: syntax error before: ')' % 7| -type maybe() :: maybe. % | ^ /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:9:7: syntax error before: 'maybe' % 9| -spec maybe() -> binary(). % | ^ /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:10:1: syntax error before: 'maybe' % 10| maybe() -> % | ^ /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:16:28: syntax error before: ')' % 16| gleam@io:println(maybe()). % | ^ /Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl:14:2: spec for undefined function main/0 % 14| -spec main() -> nil. % | ^ {failed,"/Users/jake/dev/maybe_bug_example/build/dev/erlang/maybe_bug_example/_gleam_artefacts/maybe_bug_example.erl"} ERROR Failed error=ShellCommand { program: "escript", err: None } error: Shell command failure There was a problem when running the shell command `escript`. ```
lpil commented 3 months ago

Thank you

Caracolaracol commented 3 months ago

A few days ago I started to learn Gleam, I'm doing that exercise now but I can't solve it. Now I know why, thank you.

FJSolutions commented 3 months ago

If you are following the learning path on Exercism, then this issue will completely block your progress!

lpil commented 3 months ago

I'm going to downgrade Exercism to the old OTP now

FJSolutions commented 3 months ago

I was just putting a pull request to change the 'Maybe' option to 'Possibly'. Should I bother?

Francis Judge 072 564 7502

------ Original Message ------ From "Louis Pilfold" @.**@.>> To "gleam-lang/gleam" @.**@.>> Cc "Francis Judge" @.**@.>>; "Comment" @.**@.>> Date 2024/06/12 16:33:15 Subject Re: [gleam-lang/gleam] Certain identifiers named Maybe generate invalid Erlang code on Erlang/OTP 27 (Issue #3233)

I'm going to downgrade Exercism to the old OTP now

— Reply to this email directly, view it on GitHubhttps://github.com/gleam-lang/gleam/issues/3233#issuecomment-2163172295, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACY66TQX4VGYQJPCY2D2TGDZHBL2XAVCNFSM6AAAAABIUVKJZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGE3TEMRZGU. You are receiving this because you commented.Message ID: @.***>

lpil commented 3 months ago

Sorry Francis, I just sorted it out!