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

UnexpectedError when class/module mismatch #1073

Open
ksss opened this issue Mar 9, 2024 · 0 comments · May be fixed by #1274
Open

UnexpectedError when class/module mismatch #1073

ksss opened this issue Mar 9, 2024 · 0 comments · May be fixed by #1274

Comments

@ksss
Copy link
Contributor

ksss commented Mar 9, 2024

I found Unexpected error pattern.

# sample.rbs
class Sample
end
# sample.rb
module Sample
end
# Steepfile
target :sample do
  check "sample.rb"
  signature "sample.rbs"

  configure_code_diagnostics(Steep::Diagnostic::Ruby.all_error)
end
$ bundle exec steep check
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] Unexpected error: RuntimeError
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:360:in `for_module'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:451:in `with_module_constr'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:1533:in `block (2 levels) in synthesize'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   <internal:kernel>:148:in `yield_self'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:1515:in `block in synthesize'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:694:in `synthesize'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:421:in `type_check'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:356:in `block in type_check_file'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:354:in `type_check_file'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:310:in `block (2 levels) in typecheck_source'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep.rb:191:in `measure'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:304:in `block in typecheck_source'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:303:in `typecheck_source'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/server/type_check_worker.rb:205:in `handle_job'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/server/base_worker.rb:56:in `block (2 levels) in run'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
[Steep 1.7.0.dev.2] [typecheck:typecheck@11] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)]   /Users/yuki.kurihara/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/server/base_worker.rb:46:in `block in run'
# Type checking files:

....................................................................................F

sample.rb:1:0: [error] UnexpectedError: (RuntimeError)
│ 1. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:360:in `for_module'
│ 2. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:451:in `with_module_constr'
│ 3. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:1533:in `block (2 levels) in synthesize'
│ 4. <internal:kernel>:148:in `yield_self'
│ 5. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:1515:in `block in synthesize'
│ 6. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
│ 7. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
│ 8. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
│ 9. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/type_construction.rb:694:in `synthesize'
│ 10. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:421:in `type_check'
│ 11. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:356:in `block in type_check_file'
│ 12. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
│ 13. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
│ 14. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
│ 15. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:354:in `type_check_file'
│ 16. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:310:in `block (2 levels) in typecheck_source'
│ 17. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep.rb:191:in `measure'
│ 18. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:304:in `block in typecheck_source'
│ 19. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
│ 20. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
│ 21. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
│ 22. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/services/type_check_service.rb:303:in `typecheck_source'
│ 23. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/server/type_check_worker.rb:205:in `handle_job'
│ 24. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/server/base_worker.rb:56:in `block (2 levels) in run'
│ 25. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `block in tagged'
│ 26. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:39:in `tagged'
│ 27. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/tagged_logging.rb:135:in `tagged'
│ 28. /Users/ksss/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/steep-1.7.0.dev.2/lib/steep/server/base_worker.rb:46:in `block in run'
│
│ Diagnostic ID: Ruby::UnexpectedError
│
└ module Sample
  ~~~~~~~~~~~~~
tk0miya added a commit to tk0miya/steep that referenced this issue Oct 9, 2024
tk0miya added a commit to tk0miya/steep that referenced this issue Oct 9, 2024
@tk0miya tk0miya linked a pull request Oct 9, 2024 that will close this issue
tk0miya added a commit to tk0miya/steep that referenced this issue Oct 9, 2024
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 a pull request may close this issue.

1 participant