Gale Paeper wrote:
Frank Heckenbach wrote:
While trying to do so, I found the following program in the test suite. That's wrong then, i.e., the second `import' has to be removed, right?
module nick1m2 interface; export nick1m2 = all; import nick1m1;
[...]
end.
module nick1m2 implementation; import nick1m1;
[...]
end.
You're correct in that the test program is wrong in having a module-heading imported interface-identifier repeated in the corresponding module-block import-specification. As presently written, the compiler should generate some kind of multiple definition error when it sees the second "nick1m1" import in the module nick1m2 implementation; code block.
It now says:
nick1m2.pas:13: interface `nick1m1' has already been imported
In fixing the test program, I think it would be a good idea to end up with two test programs. One which is fixed to be a legal Pascal program which performs the intended test of the original program. And a second one which specifically tests that the compiler will detect and fail this sort of module-heading and module-block inport interface-identifier duplication error.
Good idea, thanks. (nick1.pas, nick1b.pas)
Frank