| Issue 2: | Structures cannot be returned from functions | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
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))
}
|
||||||||||||
,
Nov 29, 2009
(No comment was entered for this change.)
Labels: Milestone-Release8
|
|||||||||||||
,
Nov 30, 2009
(No comment was entered for this change.)
Blockedon: 15
|
|||||||||||||
,
Nov 30, 2009
(No comment was entered for this change.)
Blockedon: 3
|
|||||||||||||
,
Dec 02, 2009
(No comment was entered for this change.)
Status: Fixed
|
|||||||||||||
|
|
|||||||||||||