Sign in Join

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

Mailing lists / fpc-devel / 2020-04

Nasty generics-bug, already known?

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Joost van der Sluis

Hi all, Sven,

I have a very nasty bug related to generics.

Suppose that I have a unit with a generic-class in it. Nothing more. This unit is in a package.

Now I also have a unit which is part of an application. Within this unit I specialize the generic class of the first unit.

Now, when I change the first unit. The changed code never makes it into my application.

(This has probably to do with the interface of the first unit, which does not change)

But also when I remove the original first unit, and recompile the package, but do not touch the ppu of the application, the changed code is not used. (This because the unit that belongs to the application already contains the specialized code from the first unit. It does not detect a change in the first unit, so nothings happens.)

The question is: is this a known bug?

If not, I can create an example and a more extensive explanation.

Regards,

Joost.

Reply by email

Sven Barth
to Joost van der Sluis
Joost van der Sluis wrote 25 lines
Hi all, Sven, I have a very nasty bug related to generics. Suppose that I have a unit with a generic-class in it. Nothing more. This unit is in a package. Now I also have a unit which is part of an application. Within this unit I specialize the generic class of the first unit. Now, when I change the first unit. The changed code never makes it into my application. (This has probably to do with the interface of the first unit, which does not change) But also when I remove the original first unit, and recompile the package, but do not touch the ppu of the application, the changed code is not used. (This because the unit that belongs to the application already contains the specialized code from the first unit. It does not detect a change in the first unit, so nothings happens.) The question is: is this a known bug? If not, I can create an example and a more extensive explanation.

Well, it is in so far known that I know that we have situations where recompilation doesn't happen correctly. Having a reproducible, simple example however would definitely help (the current examples that we have are always rather complex ones).

Regards,
Sven

Reply by email