|
|
| Author |
Message |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 20 December 2006, 0:24 AM Post subject: Enum and Function Compiler Error |
|
|
Here is a reduced testcase that illustrates the problem
| Code: | Sub Main()
Dim rc as ErrorCodeEnum
rc = Init()
End Sub
Public Enum ErrorCodeEnum
ENOERR
End Enum
Private ID as Byte
Public Function Init() as ErrorCodeEnum
Init = ENOERR
ID = 0
End Function |
The compiler (version 1.4 or 1.4.3) reports
| Code: | | Internal error: procedure.cpp(2027), Rev 739: unexpected return value type, "error_test.bas" line 14 |
|
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 20 December 2006, 0:55 AM Post subject: |
|
|
| Thanks for providing the simple test case that illustrates the problem. The cause of the problem has been located and a solution identified. Further testing is required, however. |
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 23 December 2006, 17:47 PM Post subject: |
|
|
| dkinzer wrote: | | Thanks for providing the simple test case that illustrates the problem. The cause of the problem has been located and a solution identified. Further testing is required, however. |
I have worked around the problem for now by returning an integral value and then converting back to the enum on the caller side. I can try out the fix when you have it |
|
| Back to top |
|
 |
|