Closed samiam95124 closed 1 year ago
There are a couple of side effects of the "type spagetti" approach:
Anyways, the digest method is 1/2 implemented.
Ok, so why do I suddenly care a lot about overloads in separate modules? Because IP Pascal used them extensively, and I am reusing libraries from IP Pascal (which was, after all, a large part of the point of being Pascaline compatible.). Thus I got tired of having to change the IP Pascal libraries to fit the lack of function in P6.
Function complete. Testing is another ticket.
Encountered an issue with this. Turns out ALL routines have to have a digest appended, because at the time the first routine of an overload group is parsed, we don't know if it is going to be part of an overload group. This worked, but creamed the debugger test, because it didn't know about overloads.
The fix was to have debug ignore the type endings, but that still leaves the debugger unable to handle overloads. I have opened another ticket for that.
As detailed in vs. 0.1, calls to overloads from uses or joins modules. Presently, such calls end up like:
`` module test1;
procedure x;
begin end;
overload procedure x(c: char);
begin end;
begin
end.
program test;
uses test1;
begin
x; x('c')
end.
! x; :6 :7 ! x('c') sfr l test.27 l test.27=0 cup l test1.x :7 :8 sfr l test.28 ! ldcc 'c' chkc 0 255 ! end. l test.28=0 cup l test1.x ``
This can be resolved in two different ways:
1 is simple, but the order of the overloads must match between header files and source files[1]. If that is not true, the resulting error will be strange.
2 is more secure, and it's the method IP pascal (and C++!) uses. Its more secure.
At the moment, I am leaning towards #2.