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

1.9.3 error/warning confusion #1456

Open
noproblemwiththat opened this issue Jan 3, 2025 · 0 comments
Open

1.9.3 error/warning confusion #1456

noproblemwiththat opened this issue Jan 3, 2025 · 0 comments

Comments

@noproblemwiththat
Copy link

I have a small project type-checked with steep (for which, many thanks!). I've had some warnings which I don't fully understand (see here) but up to 1.8 were only warnings. Today my monthly heartbeat CI picked up 1.9.3 for the first time and it seemed that the warnings had been promoted to errors

2025-01-03 20:12:01.579: ERROR: [Steep 1.9.3] [typecheck:typecheck@3] [background]
 [#typecheck_source(path=lib/rtree.rb)] [#type_check_file(lib/rtree.rb@lib)] [synthesize:(5:1)] 
... [synthesize:(165:5)] [singleton(::RTree) <: instance] `T <: instance` doesn't hold generally, 
but testing it with `singleton(::RTree) <: instance && instance <: singleton(::RTree)` for compatibility
2025-01-03 20:12:02.053: ERROR: [Steep 1.9.3] [typecheck:typecheck@3] [background]
[#typecheck_source(path=lib/rtree.rb)] [#type_check_file(lib/rtree.rb@lib)] [synthesize:(5:1)] 
... [synthesize:(597:5)] [singleton(::RTree::Style) <: instance] `T <: instance` doesn't hold generally, 
but testing it with `singleton(::RTree::Style) <: instance && instance <: singleton(::RTree::Style)` 
for compatibility
F.

lib/rtree.rb:349:12: [warning] Empty array doesn't have type annotation
│ Diagnostic ID: Ruby::UnannotatedEmptyCollection
│
└       ids = []
              ~~
Detected 1 problem from 1 file

as well as generating a new warning UnannotatedEmptyCollection. From a quick read around, the latter can be fixed with a

ids = [] #: Array[Integer]

so I do that, and to my surprise that fixes the error

2025-01-03 20:47:16.179: ERROR: [Steep 1.9.3] ...
...  <: instance && instance <: singleton(::RTree::Style)` for compatibility

No type error detected. 🍵

So the long standing warning, which since 1.9.3 reports ERROR is a warning, the new [warning] (on UnannotatedEmptyCollection) is in fact an error.

All a bit confusing!

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

No branches or pull requests

1 participant