|
|
| Author |
Message |
codeferret
Joined: 03 Jan 2012
Posts: 7
|
|
Posted: 11 January 2012, 1:50 AM Post subject: Returning a structure from a class method |
|
|
I am having a problem returning structures from functions within classes; the compiler says:
| Quote: | | Internal error: statement.cpp(1472), Rev 1805: no means to generate assignment code |
Here is the simplest code that will generate the problem. Can anyone explain this behavior?
| Code: | option objects
public structure thingy
public number as Integer
end structure
public class classy
public function method() as thingy
method.number = 2
end function
public function methodical() as integer
methodical = 3
end function
end class
public function func() as thingy
func.number = 1
end function
public sub main()
dim thing1 as thingy
dim thing2 as thingy
dim testObject as classy
thing1 = thing2 ' This line compiles.
thing1 = func() ' This line compiles.
thing1.number = testObject.methodical() ' This line compiles.
thing1 = testObject.method() ' This line does not compile. Why?
end sub |
|
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2514
Location: Portland, OR
|
|
Posted: 11 January 2012, 2:44 AM Post subject: Re: Returning a structure from a class method |
|
|
| codeferret wrote: | | I am having a problem returning structures from functions within classes; | This is the same problem that was reported a few days ago. The new compiler version should handle it correctly. |
|
| Back to top |
|
 |
|