[Issue 6547] Call to std.algorithm.remove causes compile error

2012-06-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6547


Jonathan M Davis jmdavisp...@gmx.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||jmdavisp...@gmx.com
 Resolution||FIXED


--- Comment #5 from Jonathan M Davis jmdavisp...@gmx.com 2012-06-08 02:05:32 
PDT ---
As of 2.059, this is the error that you get:

 q.d(10): Error: cannot implicitly convert expression (start) of type char[] to
ulong
q.d(11): Error: template std.typecons.tuple does not match any function
template declaration
/home/jmdavis/dmd2/linux/bin/../../src/phobos/std/typecons.d(687): Error:
template std.typecons.tuple(T...) cannot deduce template function from argument
types !()(char[],_error_)

which is much better than the one originally reported.

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


[Issue 6547] Call to std.algorithm.remove causes compile error

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


SomeDude lovelyd...@mailmetrash.com changed:

   What|Removed |Added

 CC||lovelyd...@mailmetrash.com
   Platform|x86_64  |All
 OS/Version|Mac OS X|All
   Severity|major   |normal


--- Comment #4 from SomeDude lovelyd...@mailmetrash.com 2012-04-22 03:24:38 
PDT ---
Reduced to normal

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


[Issue 6547] Call to std.algorithm.remove causes compile error

2012-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6547


Tim Keating itsallaboutthe...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


--- Comment #3 from Tim Keating itsallaboutthe...@gmail.com 2012-03-16 
12:26:44 PDT ---
The minimal use case described by Yuri above still occurs with 2.058.

If this isn't supposed to work for narrow strings, then perhaps a template
specialization for the unsupported types that raises a useful error message is
the right solution here?

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


[Issue 6547] Call to std.algorithm.remove causes compile error

2012-03-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6547


Tim Keating itsallaboutthe...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from Tim Keating itsallaboutthe...@gmail.com 2012-03-13 
15:39:44 PDT ---
I will say that I don't agree with this assessment -- the bug isn't really
about user error while operating on a narrow string, but about how the compiler
 library combo respond to that misuse. To wit, anytime a user gets a cryptic
error message buried deep inside a library in response to a simple mistake, you
have disempowered them from solving their own problem and derailed their
momentum in learning the language.

That said, under 2.058 the error message is now:

test.d(11): Error: cannot implicitly convert expression (start) of type
char[] to ulong

Which makes it clear that find(string, string) is returning a slice. I think
this specific issue should be closed.

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


[Issue 6547] Call to std.algorithm.remove causes compile error

2012-02-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6547


Yuri Gorobets yuri.gorob...@gmail.com changed:

   What|Removed |Added

 CC||yuri.gorob...@gmail.com


--- Comment #1 from Yuri Gorobets yuri.gorob...@gmail.com 2012-02-16 03:25:32 
PST ---
(In reply to comment #0)

This behavior appears to be as designed. The compilation problem is caused by
special treatment of the narrow strings by std.array:

http://dlang.org/glossary.html#narrow%20strings

import std.array;
import std.algorithm;

void main()
{
char[] s = narrow.dup;

s.remove(0); // Error: template std.algorithm.move(T) 
 // does not match any function template declaration
 // Error: template std.algorithm.move(T) cannot deduce 
 // template function from argument types !()(dchar,dchar)

// remove troubles are caused by the special treatment of narrow strings
// front(s) doesn't return a char reference but dchar value instead:
s.front = 'c';// Error: s.front is not an lvalue
}

dchar version works fine:

void main()
{
dchar[] u = unicoded.dup;
u.remove(0);// works fine
u.front = 'c';
}

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