Sometimes we want to use shims to define the parent class that Tapioca may have missed. (Example 1, 2)
Consider this file generated by Tapioca for a gem:
# sorbet/rbi/gems/foo@1.0.0.rbi
class Foo
end
The user knows that Foo actually inherits from Baz and wants to fix this in a shim:
# sorbet/rbi/shims/foo.rbi
class Foo < Bar
end
Tapioca check-shims command will report a useless duplicated shims, yet this redefinition should be allowed:
Duplicated RBI for ::Foo:
* sorbet/rbi/shims/foo.rbi:1:0-2:3
* sorbet/rbi/gems/foo@1.0.0.rbi:1:0-2:3
Implementation
Before reporting a shim class as a duplicate, we should check if it redefines the super class compared to the definitions we can find in the generated files.
Motivation
Sometimes we want to use shims to define the parent class that Tapioca may have missed. (Example 1, 2)
Consider this file generated by Tapioca for a gem:
The user knows that
Foo
actually inherits fromBaz
and wants to fix this in a shim:Tapioca
check-shims
command will report a useless duplicated shims, yet this redefinition should be allowed:Implementation
Before reporting a shim class as a duplicate, we should check if it redefines the super class compared to the definitions we can find in the generated files.
Tests
See automated tests.