When I try to generate python objects for the following ice definition:
Code:
struct Point {
int x;
int y;
}
struct Cursor {
Point point;
}
and I would create 2 cursor instances:
Code:
c1 = Cursor()
c2 = Cursor()
One Point instance will be shared over both object. So:
will cause
to print 3.
Now I know this is normal python behavior, but I doubt if it is desirable. It had me baffled for a while.
Also generating code for Java and C++ will cause an empty constructor to initialize everything to null. At least than it is clear you need to initialize your own instance because you get a NPE if you try to access c1.point.x.