No error when an event handler has wrong parameters lazarus / 31-LCL ---------------------------------------------------------------------- Girlbrush · 2016-10-28 11:01 Ran into this Problem while "converting" a Delphi Project into Lazarus/fpc. The Event for OnDragOver or OnStartDrag (for a TListView in this case) in Delphi had one Parameter less, "Source". Lazarus did NOT throw a warning or error on compiling, it results in an error in runtime... We need a way to know about These Problems. Delphi at least asks for user Input. Tried Delphi and Objfpc build modes. Lazarus 1.6 fpc 3.0.0 ---------------------------------------------------------------------- Thaddy · 2016-10-28 11:23 If I look at the embarcadero website I can not find that. They are about identical between Laz and Delphi. Maybe someone set some default parameters? ---------------------------------------------------------------------- Girlbrush · 2016-10-28 11:28 Yes, odd. I can't say what happened. However, even in a brand new Project, if I let Lazarus make the Event handler Skeleton, I can just delete the whole Parameter list, and there is no warning about it. For porting the Project over, it would be nice to get that Information. Before the Software has issues months down the line. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.ListView1DragOver();begin  //end; ---------------------------------------------------------------------- JuhaManninen · 2016-10-28 12:51 Quote from: Girlbrush on October 28, 2016, 01:28:22 pmHowever, even in a brand new Project, if I let Lazarus make the Event handler Skeleton, I can just delete the whole Parameter list, and there is no warning about it. Yes it is true for event handlers stored in form files (.lfm). The streaming code is not able to check method signatures. There is no easy solution in sight unfortunately. When assigning a handler in code, the compiler checks a method signature and gives an error if parameters don't match. Streaming having no checks is a problem. It effectively prevents changing any event signature in any situation because it would silently create bugs in existing code. ---------------------------------------------------------------------- Girlbrush · 2016-10-28 14:48 I think we might try running VCL Units through the Lazarus importer, and see if that throws up anything. Thanks for your answers so far, have a nice Weekend! ---------------------------------------------------------------------- Bart · 2016-10-28 16:42 Already reported as issue #23032. Bart ---------------------------------------------------------------------- Remy Lebeau · 2016-10-28 20:34 Quote from: JuhaManninen on October 28, 2016, 02:51:34 pmThe streaming code is not able to check method signatures. That is true.  But that doesn't mean the IDE itself can't validate the signatures of design-time event handlers while saving the LFM.  The Delphi IDE does (see attached image). Quote from: JuhaManninen on October 28, 2016, 02:51:34 pmThere is no easy solution in sight unfortunately. Sure there is, if the IDE has access to the RTTI at design-time. Quote from: JuhaManninen on October 28, 2016, 02:51:34 pmStreaming having no checks is a problem. It effectively prevents changing any event signature in any situation because it would silently create bugs in existing code. That same situation exists in Delphi, too.  But at least the IDE tries to help avoid it. ---------------------------------------------------------------------- Girlbrush · 2016-10-31 08:10 Quote from: Bart on October 28, 2016, 06:42:06 pmAlready reported as issue #23032. Bart It would be a nice-to-have for sure I'm not sure what happened to the Code we tried to run through Lazarus that time, that it was actually missing a Parameter, that throws a warning in Delphi. It did Highlight a possible issue if we go with importing some Code, and we assumed the IDE/Compiler would catch stuff like that.