warnings from sparta.generics lazarus / 61-Beginners ---------------------------------------------------------------------- CapelliC · 2020-07-23 14:00 My first foray into generics (I needed a fast field name to offset accessor) has brought me into sparta.generics. The compiler issuese these warnings: Code: [Select]Compile Project, Target: my_test.exe: Success, Warnings: 4, Hints: 4 generics.defaults.pas(285,33) Hint: Parameter "AFrom" not used generics.defaults.pas(285,40) Hint: Parameter "ATo" not used Warning: Constructing a class "TCustomDictionaryEnumerator$4$crcF808BEF7" with abstract method "DoMoveNext" generics.collections.pas(140,14) Hint: Found abstract method: DoMoveNext():Boolean; Warning: Constructing a class "TCustomDictionaryEnumerator$4$crcF808BEF7" with abstract method "GetCurrent" Warning: Constructing a class "TCustomDictionaryEnumerator$4$crc3715B96F" with abstract method "DoMoveNext" generics.collections.pas(140,14) Hint: Found abstract method: DoMoveNext():Boolean; Warning: Constructing a class "TCustomDictionaryEnumerator$4$crc3715B96F" with abstract method "GetCurrent" Are they harmless, specifically 'Constructing a class XXX with abstract method "YYY"' ? I never iterate the hashmap, so can ignore them ? Anyway, is there some trick to avoid them altogether ? Eventually I don't mind to patch the sources locally, if I'll find them . Thanks ---------------------------------------------------------------------- Thaddy · 2020-07-23 14:48 The compiler messages are harmless indeed, but you should upgrade to 3.2.0 and use rtl-generics (which is the same but has bug fixes and now standard) ---------------------------------------------------------------------- PascalDragon · 2020-07-24 07:41 Quote from: CapelliC on July 23, 2020, 04:00:02 pmAre they harmless, specifically 'Constructing a class XXX with abstract method "YYY"' ? I never iterate the hashmap, so can ignore them ? You can ignore them. It's some really cheeky code use to workaround some problems related to generics combined with a bug in the compiler that wrongly prints the "constructing a class with abstract methods" warning if it's called on an existing instance instead of the type. Quote from: CapelliC on July 23, 2020, 04:00:02 pmAnyway, is there some trick to avoid them altogether ? Eventually I don't mind to patch the sources locally, if I'll find them . No, you can't. And best not to mess with the code in Generics.Collections, that only leads to headaches (I know, because I'm currently doing just that). ---------------------------------------------------------------------- CapelliC · 2020-07-24 09:09 Thanks you both. At home I'm using ver. 3.2.0, indeed sparta.generics is not more required... Alas, warnings seem to have increased, will try to play with compiler options to reduce the clutter.