[Issue 8848] Array literals and AA literals are rejected as template value parameters

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

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|D1 & D2 |D2

--


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2014-10-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8848

--- Comment #6 from Kenji Hara  ---
*** Issue 3881 has been marked as a duplicate of this issue. ***

--


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2014-02-09 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8848


yebblies  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2014-02-08 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8848



--- Comment #5 from github-bugzi...@puremagic.com 2014-02-08 10:48:06 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8d8c7538922e0e863bdc0160e88d797c58d8337f
Fix Issue 8848 - Array literals and AA literals are rejected as template value
parameters

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


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2013-11-24 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8848


yebblies  changed:

   What|Removed |Added

   Keywords||pull
 CC||yebbl...@gmail.com


--- Comment #4 from yebblies  2013-11-24 17:57:22 EST ---
https://github.com/D-Programming-Language/dmd/pull/2871

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


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2013-08-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8848


Andrej Mitrovic  changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #3 from Andrej Mitrovic  2013-08-22 
14:41:26 PDT ---
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > The template spec says that they are valid (both D1 and D2),
> > 
> > So are associative arrays accepted, but simple arrays aren't?
> > 
> > template Foo(int[] X) {}
> > template Bar(int[5] X) {}
> > void main() {}
> 
> No, the current DMD accepts neither arrays or AAs in declarations. But both 
> can
> be passed in template tuple parameters.

W.r.t. arrays, is this just a parser issue? It's odd that we have this
situation:

-
// template Foo(ubyte[]) { }  // nogo
template Bar(T...) { } // ok

void main()
{
enum ubyte[] x = [1, 2];

// alias y = Foo!(x);
alias z = Bar!(x);  // ok
}
-

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


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2012-10-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8848



--- Comment #2 from Don  2012-10-19 02:40:26 PDT ---
(In reply to comment #1)
> (In reply to comment #0)
> > The template spec says that they are valid (both D1 and D2),
> 
> So are associative arrays accepted, but simple arrays aren't?
> 
> template Foo(int[] X) {}
> template Bar(int[5] X) {}
> void main() {}

No, the current DMD accepts neither arrays or AAs in declarations. But both can
be passed in template tuple parameters.

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


[Issue 8848] Array literals and AA literals are rejected as template value parameters

2012-10-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8848


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2012-10-18 02:56:16 PDT ---
(In reply to comment #0)
> The template spec says that they are valid (both D1 and D2),

So are associative arrays accepted, but simple arrays aren't?

template Foo(int[] X) {}
template Bar(int[5] X) {}
void main() {}


==>

test.d(1): Error: arithmetic/string type expected for value-parameter, not
int[]
test.d(2): Error: arithmetic/string type expected for value-parameter, not
int[5u]

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