From 6ae0a2530c9a57fc093d2159591d9cae8140d641 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 8 Jan 2026 23:46:02 +0100 Subject: fix: improve composite literal for slices --- interp/interpreter_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'interp') diff --git a/interp/interpreter_test.go b/interp/interpreter_test.go index 5d0dd55..c7c3cbc 100644 --- a/interp/interpreter_test.go +++ b/interp/interpreter_test.go @@ -269,7 +269,7 @@ func TestComposite(t *testing.T) { {src: `type T struct{N int; S string}; var t T; t = T{2, "foo"}; t`, res: `{2 foo}`}, // #03 {src: `type T struct{N int; S string}; t := T{2, "foo"}; t`, res: `{2 foo}`}, // #04 {src: `type T struct{N int; S string}; t := T{S: "foo"}; t`, res: `{0 foo}`}, // #05 - // {src: `a := []int{}`, res: `[]`}, // #06 - // {src: `a := []int{1, 2, 3}`, res: `[1 2 3]`}, // #07 + {src: `a := []int{}`, res: `[]`}, // #06 + {src: `a := []int{1, 2, 3}; a`, res: `[1 2 3]`}, // #07 }) } -- cgit v1.2.3