Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active December 4, 2016 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/d1705d7eec3cfca7352382327871ff6b to your computer and use it in GitHub Desktop.
Save maiha/d1705d7eec3cfca7352382327871ff6b to your computer and use it in GitHub Desktop.
module Core(T)
@a : Bool
end
class Base(T)
include Core(Int32)
def initialize
@a = true
end
end
Base(String).new # OK
# This code fails
class Foo < Base(String)
end
# Error in test.cr:2: instance variable '@a' of Base(String) was not initialized in all of the 'initialize' methods, rendering it nilable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment