[Issue 5980] foreach element of a type tuple of string literals is not implicitly convertible to immutable(char)*

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5980

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|future  |D2

--


[Issue 5980] foreach element of a type tuple of string literals is not implicitly convertible to immutable(char)*

2011-09-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5980


yebblies  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||FIXED


--- Comment #8 from yebblies  2011-09-07 13:56:12 EST ---
Fixed in 2.055 beta, probably the same as issue 6220.

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


[Issue 5980] foreach element of a type tuple of string literals is not implicitly convertible to immutable(char)*

2011-05-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5980



--- Comment #7 from Andrei Alexandrescu  2011-05-11 
12:44:19 PDT ---
I must be confused, sorry.

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


[Issue 5980] foreach element of a type tuple of string literals is not implicitly convertible to immutable(char)*

2011-05-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5980



--- Comment #6 from kenn...@gmail.com 2011-05-11 12:33:31 PDT ---
(In reply to comment #4)
> The conversion of a string literal to a immutable(char)* has been disallowed,
> and for arguably good reasons. You may want to use a.ptr instead.

Really? Jesse's example in comment #3 is still compilable.

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


[Issue 5980] foreach element of a type tuple of string literals is not implicitly convertible to immutable(char)*

2011-05-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5980


kenn...@gmail.com changed:

   What|Removed |Added

Summary|Can't pass __traits value   |foreach element of a type
   |as const(char)* |tuple of string literals is
   ||not implicitly convertible
   ||to immutable(char)*


--- Comment #5 from kenn...@gmail.com 2011-05-11 12:32:41 PDT ---
Actually it's a problem in foreach-ing a TupleExp of StringExp, not __traits. I
changed the title to reflect that.

-
template TypeTuple(T...) {
alias T TypeTuple;
}
void main() {
alias TypeTuple!"1" T;
usefield(T[0]); // ok
foreach (j; T)
usefield(j);// error on 2.053
}
void usefield(const(char)* foo) {
}
-

(Still, I think it's better to use .ptr then relying on it the implicit string
literal -> pointer conversion.)

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