[Issue 7081] array slice assignment should check for opAssign

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 13 05:01:08 PDT 2012


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au
          Component|Phobos                      |DMD
            Summary|BigInt array slice int      |array slice assignment
                   |assignment                  |should check for opAssign


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2012-06-13 05:03:17 PDT ---
This doesn't have anything to do with BigInt. Rather, it's a request for
implicit conversion to apply to array block assignment.

Reduced example:

struct S
{
   void opAssign(int n) {}
}

void main()
{
   S[20] s;
   s[] = 6;
}

bug.d(9): Error: cannot implicitly convert expression (6) of type int to S[]

It seems reasonable enough. It could be problematic if the thing being assigned
is an array, eg

void opAssign(int[] n) {}

but we have that problem already with block assignment to arrays of dynamic
arrays.

AFAIK array block assignment isn't mentioned in the spec at all.

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