Commit e6f894a
committed
Infer element types for array literals and NilClass for nil literals
Array literal chains (`[1, 2, 3]`) previously resolved to a bare
`Array` with no element type. Infer each child's type and attach it
as the Array's generic parameter, falling back to plain `Array` when
empty or undefined.
`simplify_literals` left the `nil` pseudo-type tag as-is instead of
converting it to `NilClass` like other literals are converted to their
class names. This also surfaced two previously-pending specs
(NilClass/nil conformance, and passing a NilClass value to a `nil`
parameter) that now pass.1 parent 42f5643 commit e6f894a
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | | - | |
| 312 | + | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments