Bug 15940 – ImplicitConversionTargets and class alias in struct

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-04-20T07:19:08Z
Last change time
2020-03-21T03:56:35Z
Keywords
pull
Assigned to
No Owner
Creator
GoldMax

Comments

Comment #0 by goldmax3000 — 2016-04-20T07:19:08Z
import std.variant; class C { } struct S { C a; alias a this; } S s = S(new C()); auto v = Variant(s); // compile error /opt/compilers/dmd2/include/std/traits.d(3636): Error: template instance std.traits.BaseClassesTuple!(S) does not match template declaration BaseClassesTuple(T) if (is(T == class)) /opt/compilers/dmd2/include/std/traits.d(4054): Error: template instance std.traits.TransitiveBaseTypeTuple!(S) error instantiating /opt/compilers/dmd2/include/std/variant.d(263): instantiated from here: ImplicitConversionTargets!(S) /opt/compilers/dmd2/include/std/variant.d(632): instantiated from here: handler!(S) /opt/compilers/dmd2/include/std/variant.d(548): instantiated from here: opAssign!(S) /d296/f123.d(10): instantiated from here: __ctor!(S)
Comment #1 by b2.temp — 2016-05-21T18:29:48Z
this is a easy-to-fix-bug in std.traits.ImplicitConversionTargets, I take.
Comment #2 by b2.temp — 2016-06-02T13:01:42Z
Comment #3 by dlang-bot — 2019-12-10T14:33:44Z
@berni44 created dlang/phobos pull request #7313 "Fix Issue 15940 - ImplicitConversionTargets and class alias in struct" fixing this issue: - Fix Issue 15940 - ImplicitConversionTargets and class alias in struct https://github.com/dlang/phobos/pull/7313
Comment #4 by dlang-bot — 2019-12-12T16:49:38Z
dlang/phobos pull request #7313 "Fix Issue 15940 - ImplicitConversionTargets and class alias in struct" was merged into master: - 2584fd837f700bf3bf08071162390d02af0341af by Bernhard Seckinger: Fix Issue 15940 - ImplicitConversionTargets and class alias in struct https://github.com/dlang/phobos/pull/7313