We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Take the following code:
abstract class Foo abstract def foo(x : Int32) end module FooM def foo(x : Int32); end end class Bar < Foo include FooM def foo(y : Int32 | String); end end
In this code, FooM correctly matches Foo's abstract def, however with #11915 + #12167 it warns:
FooM
Foo
warning in line 11 Warning: positional parameter 'y' corresponds to parameter 'x' of the overridden method Foo#foo(x : Int32), ...
The text was updated successfully, but these errors were encountered:
Similar:
module Foo abstract def foo(x : Int32) end class FooM def foo(x : Int32); end end class Bar < FooM include Foo def foo(y : Int32 | String); end end
Sorry, something went wrong.
#foo will be looked up in Bar before FooM even though FooM#foo is stricter than Bar#foo:
#foo
Bar
FooM#foo
Bar#foo
abstract class Foo abstract def foo(x : Int32) end module FooM def foo(x : Int32); 1; end end class Bar < Foo include FooM def foo(y : Int32 | String); 2; end end Bar.new.foo(0) # => 2 Bar.new.foo("") # => 2
So I think this error is appropriate, because Foo#foo is ultimately implemented in Bar, not FooM.
Foo#foo
Ah I see, thanks!
No branches or pull requests
Take the following code:
In this code,
FooM
correctly matchesFoo
's abstract def, however with #11915 + #12167 it warns:The text was updated successfully, but these errors were encountered: