Commit c7fd1c0
committed
Split parameter-driven return types into overloads
Several methods have a boolean-ish argument that determines the return
type. Express each with literal `true`/`false` overloads instead of a
single signature with a loose union return:
- `Kernel#BigDecimal`: `exception: false` returns `nil` on a conversion
failure, so `(?exception: true) -> BigDecimal` / `(exception: false) -> BigDecimal?`.
- `Thread::Queue#pop`: `non_block: true` raises `ThreadError` when the
queue is empty, so it never returns `nil` — `(true) -> E` /
`(?false, ?timeout:) -> E?`.1 parent fcc1685 commit c7fd1c0
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1719 | 1719 | | |
1720 | 1720 | | |
1721 | 1721 | | |
1722 | | - | |
| 1722 | + | |
| 1723 | + | |
1723 | 1724 | | |
1724 | 1725 | | |
1725 | 1726 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
1241 | | - | |
| 1241 | + | |
| 1242 | + | |
1242 | 1243 | | |
1243 | 1244 | | |
1244 | 1245 | | |
| |||
0 commit comments