Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal float literals crash when targeting Erlang #4116

Closed
mooreryan opened this issue Dec 29, 2024 · 1 comment · Fixed by #4118
Closed

Illegal float literals crash when targeting Erlang #4116

mooreryan opened this issue Dec 29, 2024 · 1 comment · Fixed by #4118
Labels
bug Something isn't working help wanted Contributions encouraged priority:high

Comments

@mooreryan
Copy link

The following program crashes with a non-Gleam error when targeting Erlang.

pub fn main() {
  let _ = 1.8e308
}
$ gleam run
  Compiling float_stuff
/home/ryan/projects/gleam/float_stuff/src/float_stuff.gleam:4:9: illegal float
/home/ryan/projects/gleam/float_stuff/src/float_stuff.gleam:4:16: syntax error before: '.'
/home/ryan/projects/gleam/float_stuff/build/dev/erlang/float_stuff/_gleam_artefacts/float_stuff.erl:4:2: function main/0 undefined
%    4| -export([main/0]).
%     |  ^

/home/ryan/projects/gleam/float_stuff/src/float_stuff.gleam:2:2: spec for undefined function main/0
%    2|   let _ = 1.8e308
%     |  ^

error: Shell command failure

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

Here is the result of running GLEAM_LOG=trace gleam run:
TRACE.txt

(gleam 1.6.3)

@lpil
Copy link
Member

lpil commented Dec 30, 2024

Oh yikes! Thank you for the report

@lpil lpil added help wanted Contributions encouraged priority:high labels Dec 30, 2024
@lpil lpil closed this as completed in #4118 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contributions encouraged priority:high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants