Skip to content

result should be true, with autofree result is false #7337

@danieldaeschle

Description

@danieldaeschle

What did you do?

fn main() {
	mut a := true
	b := a && if true {
		a = false
		true
	} else {
		false
	}
	println(b)
}

What did you expect to see?
true

What did you see instead?

➜  v git:(master) ✗ v run main.v
true
➜  v git:(master) ✗ v -autofree run main.v
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.Unit: Memory ManagementBugs/feature requests, that are related to the memory management of the compiler.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions