[Issue 3175] New: rejects templated ref return function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 14 10:59:37 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3175
Summary: rejects templated ref return function
Product: D
Version: 2.031
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k-foley at onu.edu
import std.stdio;
// This works
//ref int x(int[3] p) { return p[0]; }
// This works
//ref T x(T)(T[3] p) { return p[0]; }
// This does not work
//ref int x(size_t N)(int[N] p) if ( N > 0 ) { return p[0]; }
// This does not work
ref T x(T, size_t N)(T[N] p) if ( N > 0 ) { return p[0]; }
int main()
{
auto a = [1, 2, 3];
a.x = 42;
writeln( a );
return 0;
}
----
$ rdmd test.d
test.d(12): Error: variable test.N only parameters or foreach declarations can
b
e ref
C:\d\dmd.2.031\dmd2\windows\bin\rdmd.exe: Couldn't compile or execute test.d.
--
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