Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
activesupport: Update the type of Array.wrap
At present, `Array.wrap` will be return an empty tuple for untyped value because it matches to the first method_type: `(nil) -> []`. In the type world, the behavior of an empty tuple is different from an empty array. For example, calling a enumerable method will cause type an error: ``` app/app.rb:18:28: [error] Type `bot` does not have method `to_s` │ Diagnostic ID: Ruby::NoMethod │ └ Array.wrap(foo).map { |e| e.to_s } ~~~~ ``` This changes the return type of `Array.wrap` for nil value to `Array[untyped]`. refs: #683
- Loading branch information