Skip to content

Turn semicolon as empty statement into an error#15072

Merged
RazvanN7 merged 1 commit intodlang:masterfrom
dkorpel:semicolon-statement-error
Apr 4, 2023
Merged

Turn semicolon as empty statement into an error#15072
RazvanN7 merged 1 commit intodlang:masterfrom
dkorpel:semicolon-statement-error

Conversation

@dkorpel
Copy link
Contributor

@dkorpel dkorpel commented Apr 3, 2023

It's been a while: #6886

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15072"

@dkorpel dkorpel marked this pull request as ready for review April 3, 2023 13:02
Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checking this is still allowed in importC

Copy link
Member

@ljmf00 ljmf00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other empty statements? CC @JohanEngelen we have a lot of those.

@JohanEngelen
Copy link
Contributor

What about the other empty statements? CC @JohanEngelen we have a lot of those.

deprecations are already treated as errors, so if this is not adding more deprecations/errors, we're fine.

@dkorpel
Copy link
Contributor Author

dkorpel commented Apr 3, 2023

What about the other empty statements?

What other empty statements? { } is allowed.

@dkorpel
Copy link
Contributor Author

dkorpel commented Apr 3, 2023

Just double checking this is still allowed in importC

Yes, cparseStatement always allowed a semicolon as an empty statement, it never actually checked the semi or semiOk flag.

@ljmf00
Copy link
Member

ljmf00 commented Apr 3, 2023

What about the other empty statements?

What other empty statements? { } is allowed.

Sorry, I just got confused with empty declarations 🙃

@RazvanN7 RazvanN7 merged commit fa520ba into dlang:master Apr 4, 2023
@dkorpel dkorpel deleted the semicolon-statement-error branch April 4, 2023 11:50
}
---

It will now result in an error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It always has resulted in an error.

@dkorpel ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog's example is wrong, you can see the new error in the diff of the test file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants