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

checker: fix if cond with alias (fix #17818) #17821

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Mar 30, 2023

This PR fix if cond with alias (fix #17818).

  • Fix if cond with alias.
  • Add test.
type BOOL = bool

fn example() BOOL {
	return true
}

fn main() {
	if example() {
		println('Should work, or not?')
		assert true
	} else {
		assert false
	}
}

PS D:\Test\v\tt1> v run .
Should work, or not?

@medvednikov medvednikov merged commit d0702f3 into vlang:master Mar 30, 2023
@yuyi98 yuyi98 deleted the fix_if_cond_is_alias branch March 30, 2023 12:05
l1mey112 pushed a commit to l1mey112/v that referenced this pull request Jun 7, 2023
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.

bool alias cannot be used in if statement
3 participants