% solargraph typecheck --level typed tmp.rb
tmp.rb:2 - Declared return type Integer does not match inferred type Enumerator<Integer, Integer> for #foo
1 problem found.
Looking at the RBS it seems like it does indicate that a single object can be returned:
The following code:
Fails to type check with the following error:
Looking at the RBS it seems like it does indicate that a single object can be returned:
https://github.com/ruby/rbs/blob/97ed5d9492b9d2050b87dd4b247be4097e970b9d/core/enumerable.rbs#L973-L976