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

cgen: fix cross-reference field print recursively (fix #13370) #13390

Closed
wants to merge 2 commits into from

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Feb 7, 2022

This PR fix cross-reference field print recursively (fix #13370).

  • Fix cross-reference field print recursively.
  • Add test.
struct Window {
mut:
	widgets []Widget
}

struct Widget {
mut:
	parent &Window = voidptr(0)
}

fn main() {
	mut window := &Window{}

	mut btn := &Widget{}
	btn.parent = window

	window.widgets << btn

	dump(window)
	assert '$window'.len < 100
}

PS D:\Test\v\tt1> v run .
[.\\tt1.v:19] window: &Window{
    widgets: [Widget{
        parent: &<circular>
    }]
}

@yuyi98 yuyi98 closed this Feb 8, 2022
@yuyi98 yuyi98 deleted the struct_circular_str branch February 8, 2022 02:21
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

Successfully merging this pull request may close these issues.

dump() cross-reference field print recursively.
1 participant