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

Fixed #518: Support for co_await in a VarDecl and more. #542

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

andreasfertig
Copy link
Owner

The original issue uncovered more shortcomings in the coroutine transformation.

a) It appears that operator co_await is the only operator so far
which must have a space between "operator" and the operator name.

b) Since co_await is an expression the keyword can occur in a lot of
places, like lambdas. One limitation over lambdas is that a
co_await occurs only in a CoroutineBodyStmt.

This patch adds support for more case, however, some are of these
transformations lead to code that is not logically correct. For
example, all loop related statements with a co_await as a condition
or increment expression are logically incorrect and I don't know a
way to make them correct.

The original issue uncovered more shortcomings in the coroutine
transformation.

a) It appears that `operator co_await` is the _only_ operator so far
   which must have a space between "operator" and the operator name.

b) Since `co_await` is an expression the keyword can occur in a lot of
   places, like lambdas. One limitation over lambdas is that a
   `co_await` occurs only in a `CoroutineBodyStmt`.

   This patch adds support for more case, however, some are of these
   transformations lead to code that is not logically correct. For
   example, all loop related statements with a `co_await` as a condition
   or increment expression are logically incorrect and I don't know a
   way to make them correct.
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #542 (2d44e4c) into main (c5387bc) will increase coverage by 0.21%.
The diff coverage is 98.71%.

@@            Coverage Diff             @@
##             main     #542      +/-   ##
==========================================
+ Coverage   97.90%   98.12%   +0.21%     
==========================================
  Files          23       23              
  Lines        3957     3990      +33     
==========================================
+ Hits         3874     3915      +41     
+ Misses         83       75       -8     
Flag Coverage Δ
ubuntu 97.99% <98.71%> (+0.21%) ⬆️
ubuntu-libcxx 98.12% <98.71%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
CodeGenerator.h 98.82% <ø> (-1.18%) ⬇️
CoroutinesCodeGenerator.cpp 97.49% <98.66%> (+1.62%) ⬆️
CodeGenerator.cpp 99.20% <100.00%> (-0.05%) ⬇️
InsightsHelpers.cpp 98.09% <100.00%> (-0.04%) ⬇️

... and 1 file with indirect coverage changes

@andreasfertig andreasfertig merged commit 13e5b64 into main Jun 20, 2023
@andreasfertig andreasfertig deleted the fixIssue518 branch June 20, 2023 18:40
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.

1 participant