[fpc-pascal] rtl-generics: Suggestion and question

silvioprog silvioprog at gmail.com
Fri Aug 12 19:17:13 CEST 2016


Hello,

I've spend some time adapting my beta project to use the new rtl-generics
classes, however, I have some issues regarding to TDictionary class. Let's
go to a test using the example below:

=== begin code ===

var
  hash: TDictionary<string, string>;
begin
  hash := TDictionary<string, string>.Create;
end

=== end code ===

You may get the following compiler log:

=== begin log ===

generics.dictionariesh.inc(231,33) Hint: Parameter "AFrom" not used
generics.dictionariesh.inc(231,40) Hint: Parameter "ATo" not used
generics.dictionariesh.inc(54,27) Hint: Parameter "ACapacity" not used
generics.dictionariesh.inc(58,32) Hint: Parameter "AValue" not used
generics.dictionariesh.inc(69,28) Hint: Parameter "APair" not used
generics.dictionariesh.inc(87,36) Hint: Parameter "ASize" not used
generics.dictionariesh.inc(155,39) Hint: Parameter "AItems" not used
generics.dictionariesh.inc(155,71) Hint: Parameter "AKey" not used
generics.dictionariesh.inc(155,87) Hint: Parameter "AHash" not used
generics.defaults.pas(47,31) Hint: Parameter "ALeft" not used
generics.defaults.pas(47,38) Hint: Parameter "ARight" not used
generics.defaults.pas(69,35) Hint: Parameter "AValues" not used
generics.defaults.pas(69,56) Hint: Parameter "ALeft" not used
generics.defaults.pas(69,63) Hint: Parameter "ARight" not used
generics.defaults.pas(69,86) Hint: Parameter "AComparer" not used
generics.defaults.pas(78,42) Hint: Parameter "AValues" not used
generics.defaults.pas(78,72) Hint: Parameter "AItem" not used
generics.defaults.pas(79,11) Hint: Parameter "AFoundIndex" not used
generics.defaults.pas(79,39) Hint: Parameter "AComparer" not used
generics.defaults.pas(80,7) Hint: Parameter "AIndex" not used
generics.defaults.pas(80,15) Hint: Parameter "ACount" not used
generics.defaults.pas(143,27) Hint: Parameter "AValue" not used
generics.defaults.pas(47,31) Hint: Parameter "ALeft" not used
generics.defaults.pas(47,38) Hint: Parameter "ARight" not used
generics.defaults.pas(69,35) Hint: Parameter "AValues" not used
generics.defaults.pas(69,56) Hint: Parameter "ALeft" not used
generics.defaults.pas(69,63) Hint: Parameter "ARight" not used
generics.defaults.pas(69,86) Hint: Parameter "AComparer" not used
generics.defaults.pas(78,42) Hint: Parameter "AValues" not used
generics.defaults.pas(78,72) Hint: Parameter "AItem" not used
generics.defaults.pas(79,11) Hint: Parameter "AFoundIndex" not used
generics.defaults.pas(79,39) Hint: Parameter "AComparer" not used
generics.defaults.pas(80,7) Hint: Parameter "AIndex" not used
generics.defaults.pas(80,15) Hint: Parameter "ACount" not used
generics.collections.pas(143,27) Hint: Parameter "AValue" not used
generics.defaults.pas(767,30) Hint: Parameter "ALeft" not used
generics.defaults.pas(767,37) Hint: Parameter "ARight" not used
generics.defaults.pas(768,35) Hint: Parameter "AValue" not used

=== end log ===

Those hints can be a problem when we also need to check the log from other
classes, because it pollute the windows messages, so a suggestion is just
to declare the "{$WARN 5024 OFF : Parameter "$1" not used}" in the
rtl-generics units.

The question is regarding to TDictionary, because I'm not sure if it is a
concrete class on its actual implementation stage (I'm using FPC from
trunk). See the warnings below:

=== begin warns ===

generics.dictionaries.inc(158,92) Warning: Constructing a class
"TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
"DoMoveNext"
generics.dictionaries.inc(158,92) Warning: Constructing a class
"TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
"GetCurrent"
generics.dictionaries.inc(158,92) Warning: Constructing a class
"TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
"DoMoveNext"
generics.dictionaries.inc(158,92) Warning: Constructing a class
"TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
"GetCurrent"

=== end warns ===

I want to use the TDictionary in a beta project, but I'm not sure if today
it is only for experimental purposes. :-/

Thank you!

--
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160812/d0042763/attachment.html>


More information about the fpc-pascal mailing list