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

parser: fix close_scope() missing when field.name is sort, sorted(fix#20436) #20485

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Jan 11, 2024

  1. Fixed If use sort_with_compare, it will report an error #20436
  2. Add tests.
struct Foo {
	sort []int
}

fn main() {
	f := Foo{}

	fn [f] () {
		println(f.sort.len)
		assert f.sort.len == 0
	}()
}

outputs:

0

vlib/v/parser/parser.v Outdated Show resolved Hide resolved
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.

@spytheman spytheman merged commit 690961b into vlang:master Jan 11, 2024
54 checks passed
@shove70 shove70 deleted the scope branch January 11, 2024 12:38
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.

If use sort_with_compare, it will report an error
2 participants