LMessages - Lazarus 1.8.4 on MacOS lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- lelebass · 2018-06-19 09:59 Dear All, I recently come across a problem which I guess is a bug, but before filing a bug report I would like to understand better what is going on. I tried to compile under MacOS 10.13.4 with Lazarus 1.8.4 a rather large code which is compiling without problems in the same MacOS with Lazarus 1.6.4. The error which compiler raise is: Error: Incompatible types: got "TYPES.TSmallPoint" expected "CLASSES.TSmallPoint" The same code compile without issues under Windows with Lazarus 1.8.4. Tracing the error, it seems that there is something wrong with some type declarations in LMessages. I then created a very simple unit, which has only the offensive declaration: uses   LMessages; procedure Dummy(Msg : TLMMouse); var   DummyPos : TSmallPoint; begin   DummyPos:=Msg.Pos; end; And I find the same behavior: MacOS + Lazarus 1.6.4  OK MacOS + Lazarus 1.8.4  ERROR Error: Incompatible types: got "TYPES.TSmallPoint" expected "CLASSES.TSmallPoint" Someone has an idea? If this is a bug, in which project of the bug tracking should I report it?  Ciao, Daniele ---------------------------------------------------------------------- marcov · 2018-06-19 10:04 It's a known problem that has already been solved in development versions. A quick fix is to change the order of classes and types in the uses list of the unit where it happens. If that isn't the case, just try to change the dummypos declaration to  var dummy : types.tsmallpoint; and add types to the uses list. ---------------------------------------------------------------------- lelebass · 2018-06-19 11:46 Thank you! I will try to install the dev version, which is AFAIK also the most updated regarding cocoa. Ciao, Daniele ---------------------------------------------------------------------- marcov · 2018-06-19 12:51 Note that this is a Free Pascal issue. So you would need a development version of free pascal too. ---------------------------------------------------------------------- lelebass · 2018-06-19 14:25 Thank you again. I will try and report.  Ciao, Daniele ---------------------------------------------------------------------- lelebass · 2018-06-19 14:49 With Lazarus 1.8.4 adding Types between uses seems to solve the problem in both sample code and my application. uses   LMessages, Types; Testing with dev will require some more time and efforts in order to get the dev running.  Ciao, Daniele ---------------------------------------------------------------------- Zoran · 2018-06-19 16:12 Quote from: lelebass on June 19, 2018, 04:49:27 pmuses   LMessages, Types; When more than one unit contains same identifiers, compiler will take the one from the unit which appears last in the uses section. I think it is better to avoid taking care of the order in uses list, so better prefix the type with unit name, as Marco suggested: Quote from: marcov on June 19, 2018, 12:04:47 pm var dummy : types.tsmallpoint; ---------------------------------------------------------------------- lelebass · 2018-06-22 08:50 I will follow your advice. Many thanks. Ciao, Daniele