D-Programming-Language/phobos — pull request #916 by monarchdodra (2012-10-31 22:12:11+00:00)
Title: pointsTo support for static arrays

`pointsTo` made the mistake of behaving the same for dynamic arrays, and static arrays.

Static arrays don't actually *point* elements, they aggregate them (like structs). the Static Array itself *overlaps* (aliases) with its elements, but it does not *point* them.

I added a warning that (according to TDPL), stuff can't have self references anyways, so pointsTo should be used with caution.
https://github.com/monarchdodra/phobos/commit/39656f72a3786d27925ac53f771a29e401c88489

Also, a struct can have a static array, that itself contains stuff that can point other stuff. Erm... Example:
```D
struct S
{
int*[2] pp;
}
```
An instance of S can point an int.
https://github.com/monarchdodra/phobos/commit/72616a698cbb7d59603a0cf645aae38252814573

Finally, unittest:
https://github.com/monarchdodra/phobos/commit/2507059abb4196d538d74dda8f3232e959dadf3c

--------
I discovered this trying to move a static array:
```D
int[2] a;
int[2] b;
a.move(b); //HERE
```

This triggered that `a` contained a self reference (pointsTo(a,a) == true)