Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jun 1, 2025

UseStatements tests: move parse error test to own file

... and add an extra variant of the same test.

UseStatements::getType(): bug fix for unfinished closures

Of the new tests, test case 4 and 5, would previously both return "import" as the use statement type determination. This is clearly wrong.
Additionally, for test case 3, it can also still be reliably determined that this is a closure use, while it would previously return an empty string as indicator of "undetermined".

So when there is a parse error, but it can still be reliably determined that the use keyword is used for a closure use statement, the UseStatements::getType() method will now return "closure".

Includes tests.

jrfnl added 2 commits June 1, 2025 15:52
... and add an extra variant of the same test.
Of the new tests, test case 4 and 5, would previously both return `"import"` as the use statement type determination. This is clearly wrong.
Additionally, for test case 3, it can also still be reliably determined that this is a closure `use`, while it would previously return an empty string as indicator of "undetermined".

So when there is a parse error, but it can still be reliably determined that the `use` keyword is used for a closure `use` statement, the `UseStatements::getType()` method will now return `"closure"`.

Includes tests.
@jrfnl jrfnl added this to the 1.1.0 milestone Jun 1, 2025
@jrfnl jrfnl changed the title Feature/usetype split test files UseStatements::getType(): bug fix for unfinished closures Jun 1, 2025
@jrfnl jrfnl merged commit c59a5d7 into develop Jun 1, 2025
57 of 59 checks passed
@jrfnl jrfnl deleted the feature/usetype-split-test-files branch June 1, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant