Skip to content

Instantly share code, notes, and snippets.

@geolessel
Created August 23, 2018 20:11
Show Gist options
  • Save geolessel/149816b169d8d209a3d058ea7e45728d to your computer and use it in GitHub Desktop.
Save geolessel/149816b169d8d209a3d058ea7e45728d to your computer and use it in GitHub Desktop.
class App
@@windows : Array(Window) = [] of Window
def self.windows=(windows)
@@windows = windows
end
end
class Window; end
class ShapedWindow < Window; end
class CircularWindow < ShapedWindow; end
class SquareWindow < ShapedWindow; end
App.windows = [CircularWindow.new, SquareWindow.new]
# class variable '@@windows' of App must be (Array(Window) | Nil), not Array(ShapedWindow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment