The Crystal Programming Language Forum

Abstract asymmetry

module ClassMethods
  abstract def bar : String
end

abstract class Foo
  # This allows me to declare an abstract class method.
  extend ClassMethods

  # This doesn't compile, even though it would do the same as above.
  abstract def self.bar : String
end
2 Likes

Related: Abstract def class methods (e.g. constructors) · Issue #5956 · crystal-lang/crystal · GitHub.

2 Likes