diff --git a/encode_test.go b/encode_test.go index 1165f6a6..17fe65fd 100644 --- a/encode_test.go +++ b/encode_test.go @@ -2710,3 +2710,17 @@ func TestIssue441(t *testing.T) { assertErr(t, err) assertEq(t, "unexpected result", "{}", string(b)) } + +func TestIssue459(t *testing.T) { + type A struct { + A *A `json:"a,omitempty"` + } + + type B struct { + A + } + + b, err := json.Marshal(B{}) + assertErr(t, err) + assertEq(t, "unexpected result", "{}", string(b)) +}