dmd icon indicating copy to clipboard operation
dmd copied to clipboard

fix Issue 19091 - __traits(compiles) and error in templated structs l…

Open WalterBright opened this issue 4 years ago • 9 comments

…eads to missing symbol

WalterBright avatar Dec 01 '20 11:12 WalterBright

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"

dlang-bot avatar Dec 01 '20 11:12 dlang-bot

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.

WalterBright avatar Dec 01 '20 11:12 WalterBright

Hmm, this is fixed in my local copy, but not the test version. Have to look at it tomorrow.

WalterBright avatar Dec 01 '20 11:12 WalterBright

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.

WalterBright avatar Dec 03 '20 09:12 WalterBright

This is rather discouraging. The whole error gagging system appears to be a hopeless tangle.

WalterBright avatar Dec 03 '20 09:12 WalterBright

Blocked by https://github.com/dlang/dmd/pull/12017

WalterBright avatar Dec 05 '20 08:12 WalterBright

@WalterBright #12017 was merged, so is there anything blocking this PR?

PetarKirov avatar Dec 17 '20 21:12 PetarKirov

@WalterBright please rebase and let's get this in

RazvanN7 avatar Jan 06 '21 11:01 RazvanN7

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)`

RazvanN7 avatar Jan 15 '21 09:01 RazvanN7