Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Nested Conditional Blocks are Lifted when they Shouldn't Be #1115

@ScottCarda-MS

Description

@ScottCarda-MS

Describe the bug

When a conditional includes nested conditionals that are invalid for lifting, the outer conditional may incorrectly be lifted into a generated callable by the ConditionallyControlled rewrite step. See discussion with concrete examples in comments here #767 (comment).

To Reproduce

Remove the Skip condition from this test in the ClassicallyControlledSupportTests.qs and run it. The test contains a nested condition with a return statement in it. Neither of the conditionals should be lifted into their own callables because of the return statement. However, the outer condition does get lifted, resulting in incorrect behavior.

Expected behavior

The test should pass. Because the inner conditional contains a return statement, neither the inner conditional nor the outer conditional should be lifted into their own callables.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions