Skip to content
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

Record method definitions via accessors #1037

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lloeki
Copy link
Contributor

@lloeki lloeki commented Jan 29, 2024

Attempts to fix #1036

@@ -3347,6 +3347,23 @@ def type_send(node, send_node:, block_params:, block_body:, unwrap: false, tapp:
constr = self
else
receiver, method_name, *arguments = send_node.children

case method_name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is the right place to do this.


attr_reader bar: untyped
attr_writer baz: untyped
attr_accessor qux: untyped
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without the fix, reproduces the issue. With the fix it passes by not having errors in test_expectations.yml.

Should this be anywhere else instead?

@lloeki
Copy link
Contributor Author

lloeki commented Jan 30, 2024

Got this in CI:

[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)] Unexpected error: #<RuntimeError: ::Foo::Bar not found by ::Foo::Bar::Baz>
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/rbs-3.4.3/lib/rbs/resolver/constant_resolver.rb:25:in `block in initialize'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/rbs-3.4.3/lib/rbs/resolver/constant_resolver.rb:20:in `each'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/rbs-3.4.3/lib/rbs/resolver/constant_resolver.rb:20:in `initialize'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/rbs-3.4.3/lib/rbs/resolver/constant_resolver.rb:90:in `new'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/rbs-3.4.3/lib/rbs/resolver/constant_resolver.rb:90:in `initialize'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/signature_service.rb:74:in `new'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/signature_service.rb:74:in `constant_resolver'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/signature_service.rb:141:in `latest_constant_resolver'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:310:in `block (3 levels) in typecheck_source'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:356:in `block in type_check_file'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/activesupport-7.1.3/lib/active_support/tagged_logging.rb:135:in `block in tagged'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/activesupport-7.1.3/lib/active_support/tagged_logging.rb:39:in `tagged'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/activesupport-7.1.3/lib/active_support/tagged_logging.rb:135:in `tagged'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:354:in `type_check_file'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:310:in `block (2 levels) in typecheck_source'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep.rb:191:in `measure'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:304:in `block in typecheck_source'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/activesupport-7.1.3/lib/active_support/tagged_logging.rb:135:in `block in tagged'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/activesupport-7.1.3/lib/active_support/tagged_logging.rb:39:in `tagged'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/activesupport-7.1.3/lib/active_support/tagged_logging.rb:135:in `tagged'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:303:in `typecheck_source'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:213:in `block (2 levels) in update_and_check'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/3.1.0/set.rb:511:in `each_key'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/3.1.0/set.rb:511:in `each'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:211:in `block in update_and_check'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:210:in `each_value'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/lib/steep/services/type_check_service.rb:210:in `update_and_check'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/test/type_check_service_test.rb:491:in `block in test_signature_error_unknown_outer_module'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   <internal:kernel>:90:in `tap'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /home/runner/work/steep/steep/test/type_check_service_test.rb:490:in `test_signature_error_unknown_outer_module'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest/test.rb:94:in `block (3 levels) in run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest/test.rb:191:in `capture_exceptions'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest/test.rb:89:in `block (2 levels) in run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:303:in `time_it'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest/test.rb:88:in `block in run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:412:in `on_signal'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest/test.rb:239:in `with_info_handler'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest/test.rb:87:in `run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:1126:in `run_one_method'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:378:in `run_one_method'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:365:in `block (2 levels) in run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:364:in `each'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:364:in `block in run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:412:in `on_signal'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:399:in `with_info_handler'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:363:in `run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:185:in `block in __run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:185:in `map'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:185:in `__run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:162:in `run'
[Steep 1.6.0] [#typecheck_source(path=lib/a.rb)]   /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/minitest-5.21.2/lib/minitest.rb:86:in `block in autorun'

Not too sure how it's related. I'll try to take a look.

@lloeki
Copy link
Contributor Author

lloeki commented May 10, 2024

So actually master also outputs the error above and it's not the cause of the failure: it was a red herring.

bundle exec rake test TEST=test/type_check_service_test.rb N=test_signature_error_unknown_outer_module

The test failure is there:

bundle exec rake test TEST=test/langserver_test.rb N=test_run

With an opaque:

#<Thread:0x0000ffff85c57ff8 /home/lloeki/src/github.com/soutaro/steep/test/lsp_double.rb:42 run> terminated with exception (report_on_exception is true):
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/transport/io/reader.rb:16:in `gets': stream closed in another thread (IOError)
Full output on `master`
/home/lloeki/src/github.com/soutaro/steep/test/test_helper.rb:603: warning: assigned but unused variable - rbs_env
/home/lloeki/src/github.com/soutaro/steep/test/test_helper.rb:3: warning: setting Encoding.default_external
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/types/helper.rb:7: warning: assigned but unused variable - levels
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/types/name.rb:96: warning: assigned but unused variable - args
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/ignore.rb:102: warning: assigned but unused variable - begin_pos
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/ignore.rb:103: warning: assigned but unused variable - end_pos
/home/lloeki/src/github.com/soutaro/steep/lib/steep/interface/builder.rb:720: warning: mismatched indentations at 'end' with 'if' at 714
/home/lloeki/src/github.com/soutaro/steep/lib/steep/source.rb:233: warning: assigned but unused variable - resbodies
/home/lloeki/src/github.com/soutaro/steep/lib/steep/source.rb:338: warning: assigned but unused variable - node
/home/lloeki/src/github.com/soutaro/steep/lib/steep/source.rb:564: warning: assigned but unused variable - name
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:617: warning: assigned but unused variable - singleton_definition
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:745: warning: assigned but unused variable - rhs_context
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:1859: warning: assigned but unused variable - cond_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:1991: warning: assigned but unused variable - test_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:2235: warning: assigned but unused variable - cond_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:2287: warning: assigned but unused variable - body_constr
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:2814: warning: assigned but unused variable - var_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:3803: warning: assigned but unused variable - block
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/logic_type_interpreter.rb:136: warning: assigned but unused variable - receiver_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/case_when.rb:23: warning: assigned but unused variable - type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/case_when.rb:23: warning: assigned but unused variable - constr
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/case_when.rb:30: warning: assigned but unused variable - truthy
/home/lloeki/src/github.com/soutaro/steep/lib/steep/services/hover_provider/ruby.rb:127: warning: assigned but unused variable - rhs
/home/lloeki/src/github.com/soutaro/steep/lib/steep/services/completion_provider.rb:728: warning: assigned but unused variable - receiver_node
/home/lloeki/src/github.com/soutaro/steep/lib/steep/services/completion_provider.rb:728: warning: assigned but unused variable - method_name
Run options: --seed 13960

# Running:

.

Finished in 1.640360s, 0.6096 runs/s, 5.4866 assertions/s.

1 runs, 9 assertions, 0 failures, 0 errors, 0 skips
Full output on this branch
/home/lloeki/src/github.com/soutaro/steep/test/test_helper.rb:603: warning: assigned but unused variable - rbs_env
/home/lloeki/src/github.com/soutaro/steep/test/test_helper.rb:3: warning: setting Encoding.default_external
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/types/helper.rb:7: warning: assigned but unused variable - levels
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/types/name.rb:96: warning: assigned but unused variable - args
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/ignore.rb:102: warning: assigned but unused variable - begin_pos
/home/lloeki/src/github.com/soutaro/steep/lib/steep/ast/ignore.rb:103: warning: assigned but unused variable - end_pos
/home/lloeki/src/github.com/soutaro/steep/lib/steep/interface/builder.rb:720: warning: mismatched indentations at 'end' with 'if' at 714
/home/lloeki/src/github.com/soutaro/steep/lib/steep/source.rb:233: warning: assigned but unused variable - resbodies
/home/lloeki/src/github.com/soutaro/steep/lib/steep/source.rb:338: warning: assigned but unused variable - node
/home/lloeki/src/github.com/soutaro/steep/lib/steep/source.rb:564: warning: assigned but unused variable - name
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:617: warning: assigned but unused variable - singleton_definition
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:745: warning: assigned but unused variable - rhs_context
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:1859: warning: assigned but unused variable - cond_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:1991: warning: assigned but unused variable - test_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:2235: warning: assigned but unused variable - cond_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:2287: warning: assigned but unused variable - body_constr
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:2814: warning: assigned but unused variable - var_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_construction.rb:3820: warning: assigned but unused variable - block
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/logic_type_interpreter.rb:136: warning: assigned but unused variable - receiver_type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/case_when.rb:23: warning: assigned but unused variable - type
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/case_when.rb:23: warning: assigned but unused variable - constr
/home/lloeki/src/github.com/soutaro/steep/lib/steep/type_inference/case_when.rb:30: warning: assigned but unused variable - truthy
/home/lloeki/src/github.com/soutaro/steep/lib/steep/services/hover_provider/ruby.rb:127: warning: assigned but unused variable - rhs
/home/lloeki/src/github.com/soutaro/steep/lib/steep/services/completion_provider.rb:728: warning: assigned but unused variable - receiver_node
/home/lloeki/src/github.com/soutaro/steep/lib/steep/services/completion_provider.rb:728: warning: assigned but unused variable - method_name
Run options: --seed 50151

# Running:

#<Thread:0x0000ffff85c57ff8 /home/lloeki/src/github.com/soutaro/steep/test/lsp_double.rb:42 run> terminated with exception (report_on_exception is true):
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/transport/io/reader.rb:16:in `gets': stream closed in another thread (IOError)
	from /home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/transport/io/reader.rb:16:in `read'
	from /home/lloeki/src/github.com/soutaro/steep/test/lsp_double.rb:44:in `block (2 levels) in start'
	from /home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
	from /home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
	from /home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
	from /home/lloeki/src/github.com/soutaro/steep/test/lsp_double.rb:43:in `block in start'
F

Finished in 26.618453s, 0.0376 runs/s, 4.8838 assertions/s.

  1) Failure:
LangserverTest#test_run [test/langserver_test.rb:70]:
Expected: 1
  Actual: 0

1 runs, 130 assertions, 1 failures, 0 errors, 0 skips
[SlowTest] LangserverTest#test_run : 26.62s
rake aborted!
Command failed with status (1)
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/cli/exec.rb:58:in `load'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/cli/exec.rb:58:in `kernel_load'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/cli/exec.rb:23:in `run'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/cli.rb:484:in `exec'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/cli.rb:31:in `dispatch'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/cli.rb:25:in `start'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/exe/bundle:48:in `block in <top (required)>'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/gems/bundler-2.3.8/exe/bundle:36:in `<top (required)>'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/bin/bundle:25:in `load'
/home/lloeki/src/github.com/soutaro/steep/vendor/bundle/ruby/3.2.0/bin/bundle:25:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)

@lloeki lloeki force-pushed the record-methdod-definition-via-accessors branch from efa0afe to a64531f Compare May 10, 2024 10:16
The test hinges on a plain `attr_reader` going from being annotated to
unannotated.

Before the change it went from a non-error state to an error state,
which is used as a criteria for the LSP to

After the change the annotation is not required anymore, therefore the
LSP test endlessly waits for an error that never occurs.

By moving to another type of error the LSP test now passes again.

In addition the annotation was removed as it is unneeded now.
@lloeki
Copy link
Contributor Author

lloeki commented May 10, 2024

@soutaro tests are all passing now.

I feel like littering code with @dynamic is not really useful when RBS attr_reader maps 1:1 to Ruby's attr_reader.

Does the proposed code here look OK to you?

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.

Ruby::MethodDefinitionMissing with attr_reader
1 participant