Skip to content

class Crystal::RecursiveStructChecker
inherits Reference

Checks that there are no recursive structs in the program.

An example of a recursive struct is:

struct Test
  def initialize(@test : Test | Nil)
  end
end

Test.new(Test.new(nil))

Because the type of Test.@test would be: Test | Nil.

Class methods

.new(program)

View source

Methods

#check_generic_instances(type)

View source

#check_recursive(target, type, checked, path)

View source

#check_recursive_instance_var_container(target, type, checked, path)

View source

#check_single(type)

View source

#check_types(type)

View source

#path_to_s(path)

View source

#push

View source

#struct?(type)

View source