dmd
dmd copied to clipboard
fix Issue 19091 - __traits(compiles) and error in templated structs l…
…eads to missing symbol
Thanks for your pull request, @WalterBright!
Bugzilla references
| Auto-close | Bugzilla | Severity | Description |
|---|---|---|---|
| ✓ | 19091 | normal | __traits(compiles) and error in templated structs leads to missing symbol |
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#12014"
This only fixes one of the problems (the static assert one) in the issue. I'll look at the other tomorrow with a separate PR, as this still stands alone.
Hmm, this is fixed in my local copy, but not the test version. Have to look at it tomorrow.
I found the test case link14541.d completely baffling. The comment says "If instantiated contexts are different" but the whole idea is that templates in different contexts have different instantiations. This makes no sense. Anyhow, these changes cause it to give an appropriate forward reference error. Likely the whole PR https://github.com/dlang/dmd/pull/4814 should be removed as it makes no sense.
This is rather discouraging. The whole error gagging system appears to be a hopeless tangle.
Blocked by https://github.com/dlang/dmd/pull/12017
@WalterBright #12017 was merged, so is there anything blocking this PR?
@WalterBright please rebase and let's get this in
It seems like this PR is failing phobos.
td/algorithm/sorting.d(2584): Error: template `std.algorithm.mutation.copy` cannot deduce function from argument types `!()(ZipShortest!(Flag.yes, ubyte[], dchar[]), Tuple!(ubyte, dchar)[])`, candidates are:
std/algorithm/mutation.d(367): `copy(SourceRange, TargetRange)(SourceRange source, TargetRange target)`
with `SourceRange = ZipShortest!(Flag.yes, ubyte[], dchar[]),
TargetRange = Tuple!(ubyte, dchar)[]`
must satisfy the following constraint:
` isOutputRange!(TargetRange, ElementType!SourceRange)`