View mode: basic / threaded / horizontal-split · Log in · Help
June 21, 2011
[Issue 6191] New: removechars doesn't accept a const string
http://d.puremagic.com/issues/show_bug.cgi?id=6191

          Summary: removechars doesn't accept a const string
          Product: D
          Version: D2
         Platform: x86
       OS/Version: Windows
           Status: NEW
         Keywords: rejects-valid
         Severity: normal
         Priority: P2
        Component: Phobos
       AssignedTo: nobody@puremagic.com
       ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2011-06-21 10:56:03 PDT ---
DMD 2.053:

import std.string;
void main() {
   const string s = "foo5x";
   auto s2 = removechars(s, "^A-Z");
}


test.d(4): Error: template std.string.removechars(S) if (isSomeString!(S)) does
not match any function template declaration
test.d(4): Error: template std.string.removechars(S) if (isSomeString!(S))
cannot deduce template function from argument types
!()(const(immutable(char)[]),string)


(Additionally, removechars is not pure nothrow.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 22, 2012
[Issue 6191] removechars doesn't accept a const string
http://d.puremagic.com/issues/show_bug.cgi?id=6191


SomeDude <lovelydear@mailmetrash.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
                CC|                            |lovelydear@mailmetrash.com


--- Comment #1 from SomeDude <lovelydear@mailmetrash.com> 2012-04-22 03:16:18 PDT ---
Compiles and runs fine on 2.059 Win32

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 25, 2012
[Issue 6191] removechars doesn't accept a const string
http://d.puremagic.com/issues/show_bug.cgi?id=6191


bearophile_hugs@eml.cc changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
            Status|NEW                         |RESOLVED
        Resolution|                            |FIXED


--- Comment #2 from bearophile_hugs@eml.cc 2012-04-24 19:15:02 PDT ---
import std.string, std.stdio;
void main() nothrow {
   const string s = "foAo5x";
   auto s2 = removechars(s, "^A-Z");
}


With dmd 2.060alpha it gives:
test.d(4): Error: removechars is not nothrow
test.d(2): Error: function D main 'main' is nothrow yet may throw


So removechars is not nothrow, but the main problem is fixed, so I close this
issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home