Skip to content

Instantly share code, notes, and snippets.

@shadeslayer
Created April 4, 2015 21:07
Show Gist options
  • Save shadeslayer/efb8b6f874859a2f22aa to your computer and use it in GitHub Desktop.
Save shadeslayer/efb8b6f874859a2f22aa to your computer and use it in GitHub Desktop.
Error in ./t.cr:6: instantiating 'Node#each()'
root.each { |x| puts x.data }
^~~~
in ./node.cr:11: undefined method 'each' for Nil
left.each(&block) if left
^~~~
================================================================================
Nil trace:
macro getter (in /opt/crystal/src/object.cr:191):4
def left
^~~~
macro getter (in /opt/crystal/src/object.cr:191):5
@left
^~~~~
================================================================================
Error: instance variable '@left' of Node was not initialized in all of the 'initialize' methods, rendering it nilable.
Specifically in this one:
./node.cr:6
def initialize(data)
^~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment