[Issue 5843] Unable to convert a struct with an alias-this to long/ulong to int, using std.conv.to!int.

2012-04-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5843


Kenji Hara  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #3 from Kenji Hara  2012-04-23 10:42:36 PDT ---
In 2.059, std.format module treats alias this type properly.

It was fixed by the pull request:
https://github.com/D-Programming-Language/phobos/pull/488

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5843] Unable to convert a struct with an alias-this to long/ulong to int, using std.conv.to!int.

2012-04-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5843


SomeDude  changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com


--- Comment #2 from SomeDude  2012-04-23 09:06:43 
PDT ---
Both examples compile and run with 2.059 Win32.
The first one displays 0.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5843] Unable to convert a struct with an alias-this to long/ulong to int, using std.conv.to!int.

2011-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5843


kenn...@gmail.com changed:

   What|Removed |Added

Summary|Unable to format (writeln)  |Unable to convert a struct
   |a struct with an alias-this |with an alias-this to
   |to long/ulong.  |long/ulong to int, using
   ||std.conv.to!int.


--- Comment #1 from kenn...@gmail.com 2011-06-02 10:28:36 PDT ---
The underlying problem is to!int of the struct isn't defined.

-
import std.conv;
struct  {
long a;
alias a this;
}
void main() {
to!int(.init);
}
-
/usr/include/phobos/std/conv.d(99): Error: template std.conv.toImpl(T,S) if
(!implicitlyConverts!(S,T) && isSomeString!(T) && isInputRange!(Unqual!(S)) &&
isSomeChar!(ElementType!(S))) does not match any function template declaration
/usr/include/phobos/std/conv.d(99): Error: template std.conv.toImpl(T,S) if
(!implicitlyConverts!(S,T) && isSomeString!(T) && isInputRange!(Unqual!(S)) &&
isSomeChar!(ElementType!(S))) cannot deduce template function from argument
types !(int)()
/usr/include/phobos/std/conv.d(99): Error: template instance errors
instantiating template
x.d(7): Error: template instance std.conv.to!(int).to!() error
instantiating
-

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---