From 90284c5bedc5ab7bb442b34ef470744578dcd266 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 3 Dec 2025 15:28:18 +0100 Subject: feat: support literal struct expressions with keyed elements --- interp/interpreter_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'interp/interpreter_test.go') diff --git a/interp/interpreter_test.go b/interp/interpreter_test.go index 42cb7e2..4f5690d 100644 --- a/interp/interpreter_test.go +++ b/interp/interpreter_test.go @@ -260,5 +260,7 @@ func TestComposite(t *testing.T) { {src: "t := struct{}{}; t", res: "{}"}, {src: `type T struct {}; var t T; t = T{}; t`, res: "{}"}, {src: `type T struct{N int; S string}; var t T; t = T{2, "foo"}; t`, res: `{2 foo}`}, + {src: `type T struct{N int; S string}; t := T{2, "foo"}; t`, res: `{2 foo}`}, + {src: `type T struct{N int; S string}; t := T{S: "foo"}; t`, res: `{0 foo}`}, }) } -- cgit v1.2.3