[fpc-devel] Parameters must match exactly?

Florian Klaempfl florian at freepascal.org
Thu May 20 10:31:53 CEST 2010

Alexander Klenin schrieb:
> I would like to return the discussion to the original question,
> now with the real code sample ;-)
> Look at r21318 of Lazarus (tachart: fixed compilation with fpc 2.5.1,
> by Vincent).
> [BTW, is there any web-interface for browsing Lazarus SVN?]
> I think it is a typical sample of change required to production code
> by the restriction we are discussing.
> Looking at the diff, I'd argue that:
> 1) Old version was cleaner.
> 2) New version is _not_ any safer, since any type error in the old code
>   will result in exactly the same consequences with the new one.
> =>
> So, the additional inconvenience to developer did not pay off.

It does. Everybody knows now that there is happening something strange
because type casts are used.

> To really address the problem, I think compiler should insert a run-time type
> check (e.g. the as operator) automatically.

When? Before and/or after the call?

More information about the fpc-devel mailing list