Skip to content

print rewriting checks statements in else bodies too soon #4489

@tsandall

Description

@tsandall

While playing around with @anderseknert's test assertion experiment I found that print statements are getting checked incorrectly:

package play

assert_equals(a,b) { a == b }
else = false { print(a, "does not equal", b) }

test_foo {
	assert_equals(1, 2)
}

Because the compiler uses WalkBodies on the rule, it's encountering the body of the else statement before it's processed the implicit args of the else statement.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions