[Issue 9523] New: std.conv.to will no longer convert enums to themselves
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 16 20:51:33 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9523
Summary: std.conv.to will no longer convert enums to themselves
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: jmdavisProg at gmx.com
--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-02-16 20:51:30 PST ---
This compiled with 2.061
import std.conv;
enum E { a }
void main()
{
auto month2 = to!E(E.a);
}
but does not compile with the current beta for 2.062. Rather, it gives the
error:
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/conv.d(274): Error: template
std.conv.toImpl matches more than one template declaration,
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/conv.d(330):toImpl(T, S)(S
value) if (isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T) &&
!isNullToStr!(S, T)) and
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/conv.d(1654):toImpl(T, S)(S
value) if (is(T == enum) && is(S : OriginalType!(T)) &&
!isFloatingPoint!(OriginalType!(T)) && !isSomeString!(OriginalType!(T)))
q.d(7): Error: template instance std.conv.to!(E).to!(E) error instantiating
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list