My favorites | Sign in
Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 2: Structures cannot be returned from functions
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  don.apoch
Closed:  Dec 02
Type-Defect
Priority-Critical
Milestone-Release8


Sign in to add a comment

Blocked on:
issue 3
issue 15
 
Reported by don.apoch, Jun 14, 2009
At the moment the grammar misses a case where a user-defined function 
returns a structure. Specifically, the grammar does not permit 
initialization of the structure members.

The following code should reproduce this issue:


structure Vector : (real(X), real(Y), real(Z))

infix(plus)

plus : (Vector(left), Vector(right)) -> (Vector(result, 0.0, 0.0, 0.0))
{
	result.X = left.X + right.X
	result.Y = left.Y + right.Y
	result.Z = left.Z + right.Z
}


entrypoint : () -> ()
{
	Vector(a, 1.0, 1.0, 1.0)
	Vector(b, 2.0, 2.0, 2.0)

	Vector(c, a plus b)
	display(c)
}


display : (Vector(v)) -> ()
{
	debugwritestring(cast(string, v.X))
	debugwritestring(cast(string, v.Y))
	debugwritestring(cast(string, v.Z))
}


Comment 1 by don.apoch, Nov 29, 2009
(No comment was entered for this change.)
Labels: Milestone-Release8
Comment 2 by don.apoch, Nov 30, 2009
(No comment was entered for this change.)
Blockedon: 15
Comment 3 by don.apoch, Nov 30, 2009
(No comment was entered for this change.)
Blockedon: 3
Comment 4 by don.apoch, Dec 02, 2009
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Hosted by Google Code