Introduced in PR #9331, this was changed from a normal bug fix to a
-preview switch because enabling it triggered a suprious "statement is
not reachable" warning in Phobos. That warning has since been removed
(in PR #15568).
Commit a3abf1187e fixes some cases of
lambdas having unstable symbol names between compilation units by
using `generateIdWithLoc` to generate stable lambda names, however since
LOC doesn't uniquely identify a lambda instance (because templates,
mixins, static foreach and foreach unrolling), `generateIdWithLoc`
adds a counter, so there is still some instability going on.
`generateIdWithLoc` makes the name uniq per file+loc, by adding adding a
numeric suffix. But the order of instantiations might be different
across compilation units, so with this counting scheme we are back to
unstable names, so one module might have
`t!0.__lambda_LOC` and
`t!1.__lambda_LOC_1`
while another one has
`t!1.__lambda_LOC`
This is not a critical problem, but at very least the code gets
duplicated for no reason. I also have an example where it leads to
linking error, but since it's not a small one and fails to minimize
further, I suspect it's a result of interaction with some other bug.
The thing is we don't even need uniqueness for those lambdas inside
templates/mixins: their final names will have the instantiation prefix anyway.
But we can't also just disable this uniqueness check completely: `static
foreach` as well as unrollings of the normal `foreach` with lambdas in
the loop body will have several copies of a single lambda with the same
file+loc. So here we do want to keep making them unique. Fortunately, I
don't think a `foreach` could be iterated in different order in
different compilation units, so hopefully if we limit the counting to
this case only, it won't make symbols unstable.
To implement this idea, I've added an extra `parent` argument to
`generateIdWithLoc`: it works like using `parent ~ prefix` prefix, but
without adding `parent` to the final output.
Fixes since last review:
1. Changed `fromStringz` to `toDString`
2. Added a test to showcase the problem
Commit a3abf1187e fixes some cases of
lambdas having unstable symbol names between compilation units by
using `generateIdWithLoc` to generate stable lambda names, however since
LOC doesn't uniquely identify a lambda instance (because templates,
mixins, static foreach and foreach unrolling), `generateIdWithLoc`
adds a counter, so there is still some instability going on.
`generateIdWithLoc` makes the name uniq per file+loc, by adding adding a
numeric suffix. But the order of instantiations might be different
across compilation units, so with this counting scheme we are back to
unstable names, so one module might have
`t!0.__lambda_LOC` and
`t!1.__lambda_LOC_1`
while another one has
`t!1.__lambda_LOC`
This is not a critical problem, but at very least the code gets
duplicated for no reason. I also have an example where it leads to
linking error, but since it's not a small one and fails to minimize
further, I suspect it's a result of interaction with some other bug.
The thing is we don't even need uniqueness for those lambdas inside
templates/mixins: their final names will have the instantiation prefix anyway.
But we can't also just disable this uniqueness check completely: `static
foreach` as well as unrollings of the normal `foreach` with lambdas in
the loop body will have several copies of a single lambda with the same
file+loc. So here we do want to keep making them unique. Fortunately, I
don't think a `foreach` could be iterated in different order in
different compilation units, so hopefully if we limit the counting to
this case only, it won't make symbols unstable.
To implement this idea, I've added an extra `parent` argument to
`generateIdWithLoc`: it works like using `parent ~ prefix` prefix, but
without adding `parent` to the final output.
Fixes since last review:
1. Changed `fromStringz` to `toDString`
2. Added a test to showcase the problem
Removes code in the lexer responsible for removing leading spaces in
triple slash doc comments.
This affects the test file for issue 14413; two more spaces appear, but
they are not significant in the HTML output.
While updating children's `minst` only going over `members` is not
enough: structs may also have generated methods that are not in
`members`.
As a result, if a generated method instantiates a template, it gets a
poentially wrong `minst`, so can be omitted from the compilation result.
Fixes Bugzilla Issue 24830.
fix: remove unwanted comment
test(fail_compilation): add SARIF integration test case
test(fail_compilation): update tests to pass ci
test(fail_compilation): update regex
test(fail_compilation): update tests to pass ci
test(fail_compilation): update tests with regex
test(fail_compilation): update tests with regex
test(fail_compilation): changes in regex based on ci logs
test(fail_compilation): changes in regex based on ci logs
fix(remove): tool version and change uri to relative path
fix(remove): tool version variable
fix(remove): file:// path
Signed-off-by: royalpinto007 <royalpinto007@gmail.com>