[Issue 6639] Difference beetwen "foo" and "foo"c

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 10 08:36:28 PDT 2011


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



--- Comment #3 from yebblies <yebblies at gmail.com> 2011-09-11 01:36:14 EST ---
(In reply to comment #2)
> My point is maybe we don’t need unannotated string literal out of lexer.
> Maybe c is better default, but we need simple rule.
> 
> Confess I’m not aware of all consequences. 
> Something to think about, maybe?

We actually do need it to be initially untyped.  If every string literal was
implicitly utf-8, the following functions could not be called with a literal:
void fun(wstring s);
void fun(dstring s);
void fun(const(char)* s);

What is important is that a default type can be automatically used, and it
already works this way some of the time.
auto x = "blah blah"; // x is typed as string

Extending this default type to function calls seems natural to me.

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