PeterPanettone 157 Posted October 15, 2021 (edited) Today I have loaded a large project written in Delphi 10.4.2, for the first time in Delphi 11 Alexandria. The project had been grown and compiled in Delphi 10.4.2 without problems. So I was very surprised to see 90+ errors in the main unit in Delphi 11. Looking at the errors, they were mostly type-mismatches in method parameters like TShiftState or TMouseButton. First I started to add explicit scope prefixes to the parameters. But that seemed to be lengthy work, so I suddenly had an idea: I moved System.UITypes from the start of the uses clause to the end of the uses clause. That action resolved the problem and all errors disappeared! So why this worked in Delphi 10.4.2, and works in Delphi 11 only after moving System.UITypes to the end of the uses clause? Edited October 15, 2021 by PeterPanettone Share this post Link to post
Lars Fosdal 1792 Posted October 15, 2021 Considering TShiftState is declared in System.Classes in both 10.4.2 and 11, that is strange. Also, TMouseButton is declared in System.UITypes in both versions. Share this post Link to post
Lajos Juhász 293 Posted October 15, 2021 Should not be a problem, maybe I am just lucky and the uses in my project was "correct" already in 10.4.2 for me only change was the breaking changes in the interfaces that were incorrect prior to Delphi 11. Share this post Link to post
PeterPanettone 157 Posted October 15, 2021 21 minutes ago, PeterPanettone said: compiled in Delphi 10.4.2 without problems Maybe that is an optimistic expression. As the main unit became larger and larger in Delphi 10.4.2 (16,500 lines), strange effects appeared: For example, when adding a new control to the main form (in Delphi 10.4.2), the control's field name was added in the wrong place by Delphi, so I had to move the control's field name manually to the correct place. Share this post Link to post