[Issue 3857] New: Write property for arrays does not work properly
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 26 14:08:03 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3857
Summary: Write property for arrays does not work properly
Product: D
Version: 2.040
Platform: Other
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: schveiguy at yahoo.com
--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-02-26 14:08:01 PST ---
If I were to define a write property for arrays foo that takes an int arg, none
of the following prototypes work:
main code:
int[] x;
x.foo = 1;
test cases:
@property void foo(T)(T[] arr, int x) {}
or
void foo(T)(T[] arr, int x) {}
outputs:
testbug.d(10): Error: template testbug.foo(T) does not match any function
template declaration
testbug.d(10): Error: template testbug.foo(T) cannot deduce template function
from argument types !()(int[])
testbug.d(10): Error: x.foo is not an lvalue
test case:
@property void foo(int[] arr, int x) {}
outputs:
testbug.d(4): Error: properties can only have zero or one parameter
test case:
void foo(int[] arr, int x) {}
outputs:
testbug.d(10): Error: function testbug.foo (int[] arr, int x) is not callable
using argument types (int[])
testbug.d(10): Error: expected 2 function arguments, not 1
testbug.d(10): Error: x.foo is not an lvalue
testbug.d(10): Error: cannot implicitly convert expression (1) of type int to
void
I think at least the two variations that use @property should work. They are
pretty unambiguous.
This is blocking my work on the array pre-allocate patch.
--
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