-
-
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
crystal choose wrong initialize method #4086
Comments
Closing as duplicate of #2665 (generics inheritance is still broken) |
class A::C::B(T) < A
def self.new(v : T, v2 : Int32)
obj = B(T).allocate
obj.initialize(v, v2)
::GC.add_finalizer(obj) if obj.responds_to?(:finalize)
obj
end
end Here path lookup for class A
class B
end
module C
class B < A
def self.foo
# lookup tries the following types in the given order:
# B relative to ::A::C::B (direct namespace child)
# B relative to ::A (ancestors)
# B relative to ::A::C (enclosing namespace)
B
end
end
end
end
A::C::B.foo # => A::B
# same code in Ruby produces A::C::B We can either use the fully qualified name ( |
The text was updated successfully, but these errors were encountered: