[Issue 6632] toUTFz sometimes does not work with const parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 9 06:36:15 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6632


zeljkog <zeljko.grk at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zeljko.grk at gmail.com


--- Comment #1 from zeljkog <zeljko.grk at gmail.com> 2011-09-09 15:36:01 CEST ---
It is compiler issue:

import std.stdio;

void f(S)(S str){
    writeln(str);
}

alias f!(string) fc;
alias f!(wstring) fc;

void main(){
    fc("foo");      // L11

//~     fc("foo"c);     // works
//~     auto s = "foo";  
//~      fc(s);       // works  
}

//~ Compilation breaks with message:

//~ bug.d(11): Error: function alias bug.f called with argument types:
//~     ((string))
//~ matches both:
//~     bug.f!(string).f(string str)
//~ and:
//~     bug.f!(immutable(wchar)[]).f(immutable(wchar)[] str)

-- 
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