compiler: compare slice against nil

This commit is contained in:
Ayke van Laethem
2018-10-20 17:22:51 +02:00
parent 3f05490846
commit da89464a63
3 changed files with 17 additions and 0 deletions
+2
View File
@@ -1,9 +1,11 @@
foo is nil? false false
foo: len=4 cap=4 data: 1 2 4 5
bar: len=3 cap=5 data: 0 0 0
foo[1:2]: len=1 cap=3 data: 2
sum foo: 12
copy foo -> bar: 3
bar: len=3 cap=5 data: 1 2 4
slice is nil? true true
grow: len=0 cap=0 data:
grow: len=1 cap=1 data: 42
grow: len=3 cap=4 data: 42 -1 -2