Make expression.d methods private where possible#7251
Make expression.d methods private where possible#7251MartinNowak merged 13 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
| return result; | ||
| } | ||
|
|
||
| /*********************************************** |
There was a problem hiding this comment.
Didn't you mean to move modifyFieldVar to src/ddmd/expressionsem.d?
There was a problem hiding this comment.
no, the function is called just once from declaration.d. Don't know why it was in expression.
There was a problem hiding this comment.
I reviewed the pull-request commit by commit and I noticed that the commit message of this change was "Move mofifyFieldVar to expressionsem and make it private", so it would be better to change the commit message to "Move mofifyFieldVar to declaration and make it private", in order to avoid confusion.
| return new ErrorExp(); | ||
| return e; | ||
| } | ||
|
|
There was a problem hiding this comment.
Nit: remove extra whitespace.
There was a problem hiding this comment.
What extra whitespace?
There was a problem hiding this comment.
Never mind, there were three empty lines in 320581b#diff-b90dc1ef3092d86c410bd0a78271e80eR335, but it looks like you fixed this a later commit.
src/ddmd/expressionsem.d
Outdated
| * Returns: | ||
| * true a semantic error was detected | ||
| */ | ||
| private extern (C++) bool arrayExpressionToCommonType(Scope* sc, Expressions* exps, Type* pt) |
There was a problem hiding this comment.
Remove extern (C++) - it's clearly not needed as arrayExpressionToCommonType can only be called by D code from this module.
src/ddmd/expressionsem.d
Outdated
| /*************************************** | ||
| * Pull out any properties. | ||
| */ | ||
| private extern (C++) Expression resolvePropertiesX(Scope* sc, Expression e1, Expression e2 = null) |
src/ddmd/expression.d
Outdated
| * This doesn't appear to do anything. | ||
| */ | ||
| extern (C++) bool checkPropertyCall(Expression e, Expression emsg) | ||
| private extern (C++) bool checkPropertyCall(Expression e, Expression emsg) |
src/ddmd/expressionsem.d
Outdated
| * Returns: | ||
| * true an error was issued | ||
| */ | ||
| private extern (C++) bool checkDefCtor(Loc loc, Type t) |
src/ddmd/declaration.d
Outdated
| * Mark variable v as modified if it is inside a constructor that var | ||
| * is a field in. | ||
| */ | ||
| private extern (C++) int modifyFieldVar(Loc loc, Scope* sc, VarDeclaration var, Expression e1) |
src/ddmd/expression.d
Outdated
| } | ||
|
|
||
| extern (C++) Expression opAssignToOp(Loc loc, TOK op, Expression e1, Expression e2) | ||
| private extern (C++) Expression opAssignToOp(Loc loc, TOK op, Expression e1, Expression e2) |
src/ddmd/expression.d
Outdated
| /****************************************************************/ | ||
|
|
||
| extern (C++) Expression extractOpDollarSideEffect(Scope* sc, UnaExp ue) | ||
| private extern (C++) Expression extractOpDollarSideEffect(Scope* sc, UnaExp ue) |
src/ddmd/expressionsem.d
Outdated
| return (err || olderrors != global.errors); | ||
| } | ||
|
|
||
| private extern (C++) Module loadStdMath() |
|
The Jenkins failure should be fixed by dlang/phobos#5816. |
|
Looking forward to resolve merge conflicts ;). |
This PR applies the private keyword to methods in expression.d where possible. In some cases it moves functions to other files so that private can be applied.