Skip to content

Comments

Allow duplicate braces in allman style#449

Merged
1 commit merged intodlang-community:masterfrom
wilzbach:allow-duplicate-braces
Jun 13, 2017
Merged

Allow duplicate braces in allman style#449
1 commit merged intodlang-community:masterfrom
wilzbach:allow-duplicate-braces

Conversation

@wilzbach
Copy link
Member

It seems like I have tested Phobos yesterday with a wrong dscanner binary.
However, there's only one small need for amendment that I found.

Apparently e.g in std/experimental/allocator/common.d this brace style seems to be popular for static if:

        static if (hasMember!(A, "alignedAllocate"))
        {{
             auto b3 = a.alignedAllocate(1, 256);
             assert(b3.length <= 1);
             assert(b3.ptr.alignedAt(256));
             assert(a.alignedReallocate(b3, 2, 512));
             assert(b3.ptr.alignedAt(512));
             static if (hasMember!(A, "alignedDeallocate"))
             {
                 a.alignedDeallocate(b3);
             }
        }}

@wilzbach
Copy link
Member Author

FYI in case you are interested: the PR at Phobos to prepare for enabling the allman check: dlang/phobos#5480

@ghost
Copy link

ghost commented Jun 12, 2017

what's the point with this thing ? Don't know how to call it btw immediate scope ?

@wilzbach
Copy link
Member Author

what's the point with this thing ?

It's a "pattern" that appears in Phobos ...

Don't know how to call it btw immediate scope ?

Good idea.

Btw we seem to have an issue with the non-DUB builds & dmd-nightly:

containers/src/containers/treemap.d(33): Error: field tree must be initialized in constructor
containers/src/containers/treemap.d(166): Error: template instance containers.treemap.TreeMap!(int, int, StatsCollector!(FreeList!(AllocatorList!(Factory, GCAllocator), 64LU, 64LU, cast(Flag)false), 262143LU, 0LU)*, "a < b", false, 64LU) error instantiating

I think DUB managed to evade this by not trying to build it and just passing the containers as input directory?

@wilzbach
Copy link
Member Author

Btw we seem to have an issue with the non-DUB builds & dmd-nightly:

See also: https://github.com/economicmodeling/containers/issues/80

(it's a regression from dlang/dmd#6816, similarly to dlang-community/D-YAML#66)

@ghost
Copy link

ghost commented Jun 13, 2017

based on the previous comment i guess this is ok to merge.

@ghost ghost merged commit 345f264 into dlang-community:master Jun 13, 2017
@wilzbach wilzbach deleted the allow-duplicate-braces branch December 21, 2017 18:28
WebFreak001 added a commit to WebFreak001/D-Scanner that referenced this pull request Feb 2, 2022
This pull request was closed.
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