Skip to content

Stop MethodDefinitionMissing for attr_* and aliases#976

Open
tk0miya wants to merge 1 commit intosoutaro:masterfrom
tk0miya:stop_MethodDefinitionMissing_for_attr_readers
Open

Stop MethodDefinitionMissing for attr_* and aliases#976
tk0miya wants to merge 1 commit intosoutaro:masterfrom
tk0miya:stop_MethodDefinitionMissing_for_attr_readers

Conversation

@tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Dec 6, 2023

No description provided.


typing.errors[0].tap do |error|
assert_instance_of Diagnostic::Ruby::NoMethod, error
assert_equal :attr_writer, error.method # why?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why NoMethod is raised for attr_writer...


typing.errors[0].tap do |error|
assert_instance_of Diagnostic::Ruby::NoMethod, error
assert_equal :attr_accessor, error.method # why?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also.

@soutaro soutaro added this to the Steep 1.7 milestone Dec 25, 2023
case method_name
when :attr_reader
arguments.each do |arg|
module_context.defined_instance_methods << arg.children[0]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's assuming the arguments are symbol literals? Should consider the case they are not.

@soutaro soutaro removed this from the Steep 1.7 milestone Jun 7, 2024
@lloeki
Copy link
Contributor

lloeki commented Oct 18, 2024

Looks like it attempts to fix #1036, which I think I have working in #1037?

EDIT: Ah, I seem to have missed it, this one predates mine. Interesting that we solved it the exact same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants