[Issue 6639] New: Difference beetwen "foo" and "foo"c
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Sep 10 05:38:12 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6639
Summary: Difference beetwen "foo" and "foo"c
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: zeljko.grk at gmail.com
--- Comment #0 from zeljkog <zeljko.grk at gmail.com> 2011-09-10 14:37:57 CEST ---
After thinking a bit more I have concluded its important consistency issue. So
I reposted it as separate 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 (dmd 2.055) 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)
Maybe lexer should annotate string literal without StringPostfix according
source code format?
--
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