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 an error when interpo a ptr and specifier is p(fix #19048) #19049

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Aug 3, 2023

  1. Fix Unable to print memory address of a pointer receiver #19048
  2. Add test.
struct Foo {
}

fn (mut f Foo) intp_pointer() string {
	return '${f:p}'
}

fn main() {
	mut foo := Foo{}
	str1 := foo.intp_pointer()

	str2 := '${&foo:p}'
	assert str1 == str2
}
passed

@shove70 shove70 changed the title cgen: fix an error when interpo a receiver address when fmt specifier is p(fix #19048) cgen: fix an error when interpo a ptr and specifier is p(fix #19048) Aug 3, 2023
@shove70 shove70 marked this pull request as ready for review August 3, 2023 05:33
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.

@medvednikov medvednikov merged commit 9f5e9ba into vlang:master Aug 3, 2023
48 checks passed
@shove70 shove70 deleted the intp_fmt branch August 3, 2023 08:22
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.

Unable to print memory address of a pointer receiver
3 participants