You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was writing my first Crystal code for a while and I managed to hit this in 5 minutes! I think I have previous maintainer's bad luck.
Here's a minimal test case, which reproduces with --prelude=empty:
classFoodefbarendenddeffunc(&block)
block.call
endCONST=begin
foo =Foo.new
func do
foo.bar
endendCONST
Backtrace:
Nil assertion failed (NilAssertionError)
from /data/programming/crystal-lang/crystal/master/src/nil.cr:106:5 in 'not_nil!'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/fun.cr:103:47 in 'codegen_fun'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/fun.cr:51:3 in 'codegen_fun:fun_module_info:is_fun_literal:is_closure'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:549:17 in 'visit'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:2184:7 in 'accept'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/call.cr:318:5 in 'codegen_call_with_block_as_fun_literal'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/call.cr:30:9 in 'visit'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:2184:7 in 'accept'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:619:9 in 'visit'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:2184:7 in 'accept'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/const.cr:159:13 in 'create_initialize_const_function'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/const.cr:131:56 in 'initialize_const'
from /data/programming/crystal-lang/crystal/master/src/compiler/crystal/codegen/codegen.cr:930:9 in 'codegen_assign'
... boring codegen visitor doing it's visiting, clipped for length
The text was updated successfully, but these errors were encountered:
By the way, the issue seems to be that closures don't work right now inside const initializations. It should be easy to fix... once I can get things compiling again. Maybe I'll stick with LLVM 10 for now.
I was writing my first Crystal code for a while and I managed to hit this in 5 minutes! I think I have previous maintainer's bad luck.
Here's a minimal test case, which reproduces with
--prelude=empty
:Backtrace:
The text was updated successfully, but these errors were encountered: