Remove usage of CommaExp from dmd#5805
Merged
yebblies merged 2 commits intodlang:masterfrom May 27, 2016
mathias-lang-sociomantic:remove-commaexp-from-dmd
Merged
Remove usage of CommaExp from dmd#5805yebblies merged 2 commits intodlang:masterfrom mathias-lang-sociomantic:remove-commaexp-from-dmd
yebblies merged 2 commits intodlang:masterfrom
mathias-lang-sociomantic:remove-commaexp-from-dmd
Conversation
src/dtemplate.d
Outdated
| size_t j = (t2 && t2.ty == Tident && i == tp.tempinst.tiargs.dim - 1) | ||
| ? templateParameterLookup(t2, parameters) : IDX_NOTFOUND; | ||
| if (j != IDX_NOTFOUND && j == parameters.dim - 1 | ||
| && (*parameters)[j].isTemplateTupleParameter()) |
Contributor
There was a problem hiding this comment.
DMD style puts && on the right.
Contributor
Author
There was a problem hiding this comment.
IMO that's much less readable, but if it's the existing style...
Now also seems a good time to reiterate the need of a CONTRIBUTING.md file :)
Contributor
There was a problem hiding this comment.
There's a PR somewhere about auto-formatting the source, we'll get there one day.
Contributor
Author
|
Updated: diff --git a/src/dtemplate.d b/src/dtemplate.d
index 45be215..e262dae 100644
--- a/src/dtemplate.d
+++ b/src/dtemplate.d
@@ -3786,8 +3786,8 @@ extern (C++) MATCH deduceType(RootObject o, Scope* sc, Type tparam, TemplatePara
size_t j = (t2 && t2.ty == Tident && i == tp.tempinst.tiargs.dim - 1)
? templateParameterLookup(t2, parameters) : IDX_NOTFOUND;
- if (j != IDX_NOTFOUND && j == parameters.dim - 1
- && (*parameters)[j].isTemplateTupleParameter())
+ if (j != IDX_NOTFOUND && j == parameters.dim - 1 &&
+ (*parameters)[j].isTemplateTupleParameter())
{
/* Given:
* struct A(B...) {}
diff --git a/src/expression.d b/src/expression.d
index 2e195d6..63a0b9a 100644
--- a/src/expression.d
+++ b/src/expression.d
@@ -12796,10 +12796,10 @@ public:
e2y = (cast(CommaExp)e2y).e2;
CallExp ce = (e2y.op == TOKcall) ? cast(CallExp)e2y : null;
- DotVarExp dve = (ce !is null && ce.e1.op == TOKdotvar)
+ DotVarExp dve = (ce && ce.e1.op == TOKdotvar)
? cast(DotVarExp)ce.e1 : null;
- if (sd.ctor && ce && dve && dve.var.isCtorDeclaration()
- && e2y.type.implicitConvTo(t1))
+ if (sd.ctor && ce && dve && dve.var.isCtorDeclaration() &&
+ e2y.type.implicitConvTo(t1))
{
/* Look for form of constructor call which is:
* __ctmp.ctor(arguments...)
diff --git a/src/func.d b/src/func.d
index cfa45fe..ba4836f 100644
--- a/src/func.d
+++ b/src/func.d
@@ -1275,9 +1275,9 @@ public:
* the function body.
*/
TemplateInstance ti;
- if (fbody
- && (isFuncLiteralDeclaration() || (storage_class & STCinference) || (inferRetType && !isCtorDeclaration()) || isInstantiated() && !isVirtualMethod()
- && ((ti = parent.isTemplateInstance()) is null || ti.isTemplateMixin() || ti.tempdecl.ident == ident)))
+ if (fbody &&
+ (isFuncLiteralDeclaration() || (storage_class & STCinference) || (inferRetType && !isCtorDeclaration()) || isInstantiated() && !isVirtualMethod() &&
+ ((ti = parent.isTemplateInstance()) is null || ti.isTemplateMixin() || ti.tempdecl.ident == ident)))
{
if (f.purity == PUREimpure) // purity not specified
flags |= FUNCFLAGpurityInprocess; |
Contributor
Author
|
Anything else I need to do on my end ? |
Contributor
|
Auto-merge toggled on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #5737