Closed tk0miya closed 2 months ago
The Enumerator::Chain#chain type expects an instance of Enumerator::Chain[T] as its argument. As a result, Steep detects nested #chain calls as a type error.
Enumerator::Chain#chain
Enumerator::Chain[T]
#chain
Input:
array = [1, 2, 3] array.chain([4, 5, 6]).chain([7, 8, 9])
Result:
$ bundle exec steep check # Type checking files: ..........................................................................................................................................................................................F....................................... app/example.rb:2:29: [error] Cannot pass a value of type `::Array[::Integer]` as an argument of type `::Enumerator::Chain[::Integer]` │ ::Array[::Integer] <: ::Enumerator::Chain[::Integer] │ ::Object <: ::Enumerator::Chain[::Integer] │ ::BasicObject <: ::Enumerator::Chain[::Integer] │ │ Diagnostic ID: Ruby::ArgumentTypeMismatch │ └ array.chain([4, 5, 6]).chain([7, 8, 9]) ~~~~~~~~~ Detected 1 problem from 1 file
Environment:
Fixed by #1989. Closing.
The
Enumerator::Chain#chain
type expects an instance ofEnumerator::Chain[T]
as its argument. As a result, Steep detects nested#chain
calls as a type error.Input:
Result:
Environment: