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

Nil assertion failed when defining an array with constans #10574

Closed
Xosmond opened this issue Apr 3, 2021 · 2 comments
Closed

Nil assertion failed when defining an array with constans #10574

Xosmond opened this issue Apr 3, 2021 · 2 comments
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. status:duplicate

Comments

@Xosmond
Copy link

Xosmond commented Apr 3, 2021

Bug Report

Hello, I was playing with crystal and trying to reproduce arrays with constants like ruby, and I found this bug:

NAMES = [ NAME = "name" ]
puts NAMES.inspect
crystal sample.cr
Nil assertion failed (NilAssertionError)
  from raise<NilAssertionError>:NoReturn
  from Nil#not_nil!:NoReturn
  from Crystal::CleanupTransformer#transform<Crystal::Assign>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::CleanupTransformer#transform<Crystal::TypeOf>:Crystal::TypeOf
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::CleanupTransformer#transform<Crystal::Call>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::CleanupTransformer#transform<Crystal::Assign>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::CleanupTransformer#transform<Crystal::Expressions>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::CleanupTransformer#transform<Crystal::Assign>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::CleanupTransformer#transform<Crystal::Expressions>:Crystal::ASTNode+
  from Crystal::ASTNode+@Crystal::ASTNode#transform<Crystal::CleanupTransformer>:Crystal::ASTNode+
  from Crystal::Program#visit_main<Crystal::ASTNode+, Crystal::MainVisitor, Bool, Bool>:Crystal::ASTNode+
  from Crystal::Program#semantic<Crystal::ASTNode+, Bool>:Crystal::ASTNode+
  from Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result
  from Crystal::Command#run_command<Bool>:Nil
  from Crystal::Command#run:(Bool | Nil)
  from __crystal_main
  from main
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues

Crystal version:

Crystal 1.0.0 [dd40a2442] (2021-03-22)

LLVM: 6.0.1
Default target: x86_64-apple-macos
@Xosmond Xosmond added the kind:bug A bug in the code. Does not apply to documentation, specs, etc. label Apr 3, 2021
@HertzDevil
Copy link
Contributor

#10281, especially #10281 (comment).

@Xosmond
Copy link
Author

Xosmond commented Apr 3, 2021

Closing, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. status:duplicate
Projects
None yet
Development

No branches or pull requests

3 participants