Bug 19696 – ReplaceType replaces type with the type forwarding using alias this
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-02-23T15:47:24Z
Last change time
2019-08-02T02:47:23Z
Keywords
pull
Assigned to
No Owner
Creator
Sönke Ludwig
Comments
Comment #0 by sludwig — 2019-02-23T15:47:24Z
Test case:
---
import std.typecons : ReplaceType;
struct S {
T!int t;
alias t this;
}
struct T(U) {}
// fails with !is(T!int == S)
static assert(is(ReplaceType!(float, float, S) == S));
---
If T is instead a non-template type, the result is S, as expected.
Comment #1 by snarwin+bugzilla — 2019-07-31T23:16:33Z
*** Issue 19703 has been marked as a duplicate of this issue. ***
Comment #2 by dlang-bot — 2019-07-31T23:41:02Z
@pbackus created dlang/phobos pull request #7121 "Fix issues 19696, 19697, 16132 - ReplaceType bugs" fixing this issue:
- Fix issues 19696, 19697, 16132 - ReplaceType bugs
ReplaceType no longer gives incorrect results for types that can be
implicitly converted to a templated type, either via inheritance (19697,
16132) or alias this (19696).
https://github.com/dlang/phobos/pull/7121
Comment #3 by dlang-bot — 2019-08-02T02:47:23Z
dlang/phobos pull request #7121 "Fix issues 19696, 19697, 16132 - ReplaceType bugs" was merged into stable:
- e7d6e9ff508fee42eea9986c0fb59bd3546b862f by Paul Backus:
Fix issues 19696, 19697, 16132 - ReplaceType bugs
ReplaceType no longer gives incorrect results for types that can be
implicitly converted to a templated type, either via inheritance (19697,
16132) or alias this (19696).
https://github.com/dlang/phobos/pull/7121