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

replace gotos in initializerSemantic() with return err() #12663

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

WalterBright
Copy link
Member

Fewer goto's, fewer lines of code, what's not to like?

@WalterBright WalterBright added Easy Review Refactoring No semantic changes to code labels Jun 9, 2021
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

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#12663"

@@ -95,6 +95,11 @@ extern(C++) Initializer initializerSemantic(Initializer init, Scope* sc, ref Typ
{
Type t = tx;

static Initializer err()
{
return new ErrorInitializer();
Copy link
Contributor

Choose a reason for hiding this comment

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

(maybe out of the scope of this PR but) We have ErrorExp.get() as a singleton instance, why not ErrorInitializer.get() too?

Copy link
Member Author

Choose a reason for hiding this comment

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

A good idea, but for another PR.

@WalterBright WalterBright merged commit f1692f5 into dlang:master Jun 10, 2021
@WalterBright WalterBright deleted the initsemErr branch June 10, 2021 06:58
UplinkCoder pushed a commit to UplinkCoder/dmd that referenced this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Review Refactoring No semantic changes to code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants