Closed wrightsl closed 9 months ago
It fails even if you define PROCEDURE (VAR da:DynamicArrayDesc) Init*(initialSize:LONGINT); However it correctly complains if you define both versions. P.S. same environment as before linux64, with INTEGER is INT16 as the code comes from Linz Oberon (Which currently has 104 modules and growing which is now causing problems with Module IMPORTs and too many exported structures, which is why I would like to use your system provided there are not similar restrictions).
Just made a project with your two modules and started to analyze the issue. I initially got two issues because of undelimited comments in Test2, so added ''. Then I got an issue from Test2 that it cannot import Test1.DynamicArrayDesc because it is not public, so I added a '' behind DynamicArrayDesc declaration in Test1.
Somehow the stars seem to get lost when you copy/paste the code to github. You could try to attach the source files to the comment directly instead.
Now the two modules compile without issues and I will now follow your instructions to reproduce the issue.
EDIT: just noticed that also my stars get lost in the commend unless I escape by '\': \'*\'
Ok, I can reproduce the issue. I also get crashes in the IDE, which are likely due to the incremental build feature which I recently added (which seems not yet to be stable and I should disable). There seems to be an issue with the CIL code generator. I quickly generated and compiled C code where the issue doesn't seem to appear.
I will generate ILASM and review the generated code.
I had all kinds of strange effects, including crashes of the IDE after some kind of edits. The generated IL code sometimes lacked record definitions (including the bound procedures). I now made all the incremental parse and build machinery optional by default with a new menu entry (with a hint that it is not stable yet). The C code generator didn't support incremental compilation and thus was not affected. Here is the commit: https://github.com/rochus-keller/Oberon/commit/b241cbd00861f652af96868ec72e67573118e6f6. I again uploaded a new Linux x64 version: http://software.rochus-keller.ch/OberonIDE_linux_x86_64.tar.gz
Thanks
In my application I get an error that the IDE can't find: PROCEDURE (VAR da:DynamicArrayDesc) Init(initialSize:LONGINT); even though I have a PROCEDURE (da:DynamicArray) Init(initialSize:LONGINT); these should be interchangeable/identical/equivalent (depending on the implementation). I have tried to construct some test modules as follows:
MODULE Test1;
TYPE Element = POINTER TO ElementDesc; ElementDesc = RECORD END; ElementArray* = POINTER TO ARRAY OF Element;
( An adjustable size array of Elements ) DynamicArrayDesc = RECORD array:ElementArray; length:LONGINT; size:LONGINT; iterPos:LONGINT; ( status:Errors.ErrorRec; *) END;
PROCEDURE (da:DynamicArray) Init*(initialSize:LONGINT); BEGIN da.length := 0; da.size := initialSize; da.iterPos := 0; END Init;
( PROCEDURE (VAR da:DynamicArrayDesc) Init(initialSize:LONGINT); BEGIN da.length := 0; da.size := initialSize; da.iterPos := 0; END Init; ) PROCEDURE NewDynamicArray(initialSize:LONGINT):DynamicArray; VAR da:DynamicArray; BEGIN NEW(da); IF initialSize <= 8 THEN initialSize := 8 END; NEW(da.array, initialSize); da.Init(initialSize); RETURN da END NewDynamicArray;
END Test1.
MODULE Test2; IMPORT Test1;
TYPE DynamicList* = POINTER TO DynamicListDesc;
( list: ElementArray; length: LONGINT; *) END;
PROCEDURE (dl:DynamicStringList) Init(initialSize:LONGINT); BEGIN ( dl.length := 0; dl.size := initialSize; ( dl.status := Errors.makeOKStatus(); ) dl.iterPos := 0; *) dl.Init^(initialSize) END Init;
PROCEDURE NewDynamicStringList*(initialSize:LONGINT):DynamicStringList; VAR dl:DynamicStringList; BEGIN NEW(dl); IF initialSize <= 8 THEN initialSize := 8 END; NEW(dl.array, initialSize); dl.Init(initialSize); RETURN dl END NewDynamicStringList;
PROCEDURE Run*; VAR globalDSL:DynamicStringList; BEGIN globalDSL := NewDynamicStringList(8); END Run;
END Test2.
which give the error: System.MissingMethodException: Method not found: void .DynamicArrayDesc.Init(int) at Test2.NewDynamicStringList (System.Int32 initialSize) [0x00029] in /home/slw/Develop/OberonCombined/ObxIDE/ASDLSupport/Test2.Mod:35 at Test2.Run () [0x00004] in /home/slw/Develop/OberonCombined/ObxIDE/ASDLSupport/Test2.Mod:42 at OBX.Runtime.pcall (OBX.Command cmd, System.Boolean report) [0x00000] in <886ef6ed1e5e447891bce617b8a05575>:0
Note that it works when the code is put into one Module suggesting some sort of linkage problem. Note also that the execution does not step into PROCEDURE (dl:DynamicStringList) Init*(initialSize:LONGINT); when single-stepping in Debug mode.