History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-313
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Joachim Ante
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

changing struct values accessed with properties

Created: 01/May/05 03:14 PM   Updated: 27/Jun/05 09:35 PM
Component/s: None
Affects Version/s: 0.5
Fix Version/s: 0.5.6

Time Tracking:
Not Specified


 Description  « Hide
I have a struct Vector3 in created with C# in a dll which is used by a boo script:
struct Vector3 { float x,y, z; }
And a class Transform:
class Transform
{
public Vector3 position { get { ... } set { ... }}
}

When i write in boo:
Transform transform = Transform ()
transform.position.x += 5

Nothing happens. I presume it will just change the value of the struct and then throw the struct away.

Boo should instead transform the code to something like this:

temp = transform.position;
temp.x += 5
transform.position = temp



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 17/May/05 06:08 PM
I've just checked in a fix to the simple case above. But the same problem can still happen with nested property accesses:

struct Point:
public x as int
public y as int

struct Rectangle:
[property(topLeft)]
_top as Point

class Figure:
[property(rect)]
_rect as Rectangle

f = Figure()
f.rect.topLeft.x = 10

assert 10 == f.rect.topLeft.x