Commit 89baedc
authored
compiler/prelude: Keep nil slice nil when slicing. (#852)
According to the Go specification:
> If the sliced operand of a valid slice expression is a nil slice,
> the result is a nil slice.
This behavior was not implemented and not caught previously.
Slicing a nil slice would incorrectly make it an empty but non-nil slice.
This change fixes that.
The minified prelude was regenerated with:
go generate ./compiler/prelude
Fixes #851.1 parent 0892b62 commit 89baedc
3 files changed
+41
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
0 commit comments