Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Nested structs and pointers panic #59

Open
Madongming opened this issue Aug 7, 2020 · 1 comment
Open

Copy Nested structs and pointers panic #59

Madongming opened this issue Aug 7, 2020 · 1 comment

Comments

@Madongming
Copy link

Madongming commented Aug 7, 2020

Like this

type Elem1 struct {
       E Elem1
       E1 int
}

type Elem2 struct {
       E Elem2
       E1 int
}

type A struct {
       B Elem1
}

type C struct {
       B Elem2
}

a := new(A)
c := new(C)
copy(c, a)

will panic

@yudgnahk
Copy link

struct Elem1 includes Elem1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants