We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
rbs validate shows RBS::InstanceVariableDuplicationError if one class includes a module twice. Is it intentional?
rbs validate
RBS::InstanceVariableDuplicationError
module M @iv: untyped end class C include M include M end
$ rbs -I. validate E, [2025-04-07T15:08:43.141421 #23447] ERROR -- rbs: ./test.rbs:2:2...2:14: Duplicated instance variable name `@iv` in `::M` (RBS::InstanceVariableDuplicationError) @iv: untyped
I realized this problem in the following code in a real Rails application.
module M @iv: untyped end module X include M end class C include M include X end
Our code base (unfortunately) has such code. The module M is included twice, directly and indirectly.
M
I guess it can happen in other cases on complex inheritance trees.
Also, the duplication is not harmful. Because these ivar definitions are the same. So I think we can suppress the error in this case.
Even if it should be an error, I think we should fix the error message because it's confusing.
The text was updated successfully, but these errors were encountered:
There are some possible improvements for this:
DefinitionBuilder
We won't take any action for now. If more user reports this problem, we can disable the validation for now, in 3.9.x.
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
rbs validate
showsRBS::InstanceVariableDuplicationError
if one class includes a module twice. Is it intentional?Problem
Real world example
I realized this problem in the following code in a real Rails application.
Our code base (unfortunately) has such code. The module
M
is included twice, directly and indirectly.I guess it can happen in other cases on complex inheritance trees.
Also, the duplication is not harmful. Because these ivar definitions are the same. So I think we can suppress the error in this case.
Even if it should be an error, I think we should fix the error message because it's confusing.
The text was updated successfully, but these errors were encountered: