Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-10

Error: compilation raised exception internally

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Rafael Picanço

Hi everyone,

I am getting a strange error when compiling a project. I am really not sure what is going on, because it occurs sometimes, consistently in some lines of the code with calls to this static variable:
...
function NextID(ID : word) : word;
...
NextID(ContainerClass.SomeTypeInstance.ID)
...
type
TSomeType = class(TSomeBaseClass)

  public
    ID : TTrialID; static;
  end;

I hit F9 again and then the project compiles with error.

Any suggestions? Should I care about this error and report it??

Best,
R

Sven Barth
to Rafael Picanço

Rafael Picanço via fpc-pascal schrieb am
Sa., 21. Okt. 2023, 02:50:

Show quoted text 20 lines
Hi everyone, I am getting a strange error when compiling a project. I am really not sure what is going on, because it occurs sometimes, consistently in some lines of the code with calls to this static variable: ... function NextID(ID : word) : word; ... NextID(ContainerClass.SomeTypeInstance.ID) ... type TSomeType = class(TSomeBaseClass) public ID : TTrialID; static; end; I hit F9 again and then the project compiles with error. Any suggestions? Should I care about this error and report it??

An exception or an internal error during compilation should *always* be reported.
Please also provide a minimal, self contained example that shows the problem.

Regards,
Sven

Thomas Kurz
to Sven Barth
An exception or an internal error during compilation should *always* be reported. Please also provide a minimal, self contained example that shows the problem.

This is not always trivial because the internal errors are sometimes quite fiddly. I have a project in which an internal error occurs sometimes. When I do a "cleanup and build" (in Lazarus), it works well. There seems to be an influence of the order in which units are compiled, because I can change code in many places without getting the internal error again. But when I change code in other units, I get the internal error, but it's clearly uncorrelated to the line at which it occurs.

Sven Barth
to Thomas Kurz

Thomas Kurz via fpc-pascal schrieb am
Sa., 21. Okt. 2023, 19:22:

Show quoted text 13 lines
> An exception or an internal error during compilation should *always* be > reported. > Please also provide a minimal, self contained example that shows the > problem. This is not always trivial because the internal errors are sometimes quite fiddly. I have a project in which an internal error occurs sometimes. When I do a "cleanup and build" (in Lazarus), it works well. There seems to be an influence of the order in which units are compiled, because I can change code in many places without getting the internal error again. But when I change code in other units, I get the internal error, but it's clearly uncorrelated to the line at which it occurs.

Without a way to reproduce and debug the issue it's very unlikely to get solved especially if it's a problem that only occurs in very specific circumstances.

Regards,
Sven