-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract method implemented via extend self not considered to be implemented in some circumstances #8096
Comments
So, when you use module Caller
extend self
# extend ICallable(Nil)
abstract def self.call(foo : Proc(T))
def call(foo : Proc(Nil))
end
end and as you can see the This issue is invalid. Did you maybe mean to use |
Therefore this code: module ICallable
abstract def call(foo)
end
module Caller
extend self
extend ICallable
def call(foo)
end
end shouldn't work either? Because it's the same thing minus the types, and it works. |
abstract def for class methods doesn't make sense. Maybe it's a bug. I think abstract class methods shouldn't compile, but here you get one through extend. What are you trying to do? |
I would also try to avoid |
It's not really an abstract class method. It's just an abstract method that just happens to be implemented by a module that extends itself. In this case, Caller itself is a ICallable for the purpose of for example adding it to an Array(ICallable) so it makes sense that it should conform to the protocol established by ICallable. |
O, actually, I think you are right. Workaround for now is to remove the abstract method... I guess. |
@exilor Fixed! And sorry for the initial misunderstanding. |
This worked in 0.29.0:
In 0.30.1 it says that the abstract method
call
must be implemented byCaller:Module
.def call
todef self.call
.The text was updated successfully, but these errors were encountered: