[Lazarus] How well should Lazarus check method parameters?

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Feb 24 15:03:29 CET 2012


On Fri, 24 Feb 2012 14:42:08 +0100
Sven Barth <pascaldragon at googlemail.com> wrote:

> Am 24.02.2012 13:58 schrieb "Flávio Etrusco" <flavio.etrusco at gmail.com>:
> >
> > On Fri, Feb 24, 2012 at 10:42 AM, Vincent Snijders
> > <vincent.snijders at gmail.com> wrote:
> > > Op 24 februari 2012 13:13 heeft Flávio Etrusco
> > > <flavio.etrusco at gmail.com> het volgende geschreven:
> > >>
> > >> I can't see any way to justify this not being catch by the compiler as
> > >> an _error_. We should report it in the fpc-devel ML or in mantis.
> > >
> > > A compiler doesn't read the lfm file.
> > >
> > > Vincent.
> > >
> > > --
> >
> > Oops, I thought I tested it with code, not the designer (and now I see
> > that test would've been meaningless anyway). I stand corrected.
> > The current RTTI doesn't provide that much detail yet, then only the
> > IDE can make that check, right?
> 
> Correct.
> 
> And AFAIK the object inspector already does not provide methods with
> incompatible declarations (though I don't know whether "var", "const" and
> "constref" are considered different).

In general: yes.
It depends on the calling convention if you notice it.

> So in a current Lazarus you might not
> be able to achieve a situation like this, but it will not warn/fail if an
> older form contains such an event handler.
> 
> (My assumption is not completely verified, so handle wit care)

A check project/package dialog is needed to do various checks,
including lfm files. But this has low priority to me.

Mattias




More information about the Lazarus mailing list