Yes you are certainly using features in more complex ways than most other Phrogram users and you did a great job producing a small repro that made it very easy for me to identify the bug.
For the benefit of others who may be wondering what is going on I will try to explain in simple terms.
.Net has 2 kinds of variable types. Value types and Reference types and in Phrogram we honor the same definitions though in general we don't have to explain in such detail because of the types of program people write.
Value types are integers, booleans and decimals and any types you make yourself using structures. When you refer to a value type variable you are talking about the actual value.
Reference types are any built in objects and any types you make yourself using classes. When you refer to a reference type you are talking about a reference to a value stored somewhere else in memory. This is similar to pointers in languages like C++
There's several differences between the 2 but the most important is that when you assign them different things happen.
Define a as integer = 12
Define b as integer = a
a = 99
Console.WriteLine(b)
This program prints 12. Changing a has no effect on b because value types copy the data when you assign them to each other
Class myType
Define a as integer
End Class
Define x as myType
x.a = 12
Define y as myType = x
x.a = 99
Console.WriteLine(y.a)
This program prints 99. Seems odd? When you assign y=x it doesn't copy the data inside the class because classes are reference types. This means that x is a reference to the data stored inside it and when you say y=x you copy the reference. So now y and x both refer to the same values in memory. So changing x.a also has the effect of changing y.a
However if we take the almost identical program and change the class to a structure
Structure myType
Define a as integer
End Structure
Define x as myType
x.a = 12
Define y as myType = x
x.a = 99
Console.WriteLine(y.a)
Then the program outputs 12. Structures are value types so y=x makes a copy of the data and you end up with 2 different sets of values.
In the case of the bug when you put a struct inside another struct Phrogram treats the inside struct as a reference type instead of the value type that it is supposed to be. So you get a horrible mix of this behaviour. The outer struct gets copied properly but the inner struct ends up pointing to the same data and changing one ends up changing the other one.
Hope that was useful for people.
Managed DirectX and XNA ? Check out
http://www.thezbuffer.com