You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I simplified my code as follow, I was expecting to create a dictionary from another, but it fails. actual := TCounter.Create(expected); raise a compiling error.
dictionarytest.pas(12,37) Error: Incompatible type for arg no. 1: Got "TDictionary<System.Char,System.LongInt>", expected "TEnumerable<dictionarytest.TPair<System.Char,System.LongInt>>"
I dug some source code, but it is too complex to find the inheritance of TDictionary class.
Please help, if I took something wrong.
{$mode objfpc}{$H-}{$J+}program dictionarytest;
uses Generics.Collections;
type
TCounter = specialize TDictionary<Char, Integer>;
var
expected, actual: TCounter;
begin
expected := TCounter.Create;
actual := TCounter.Create(expected);
end.
```
The text was updated successfully, but these errors were encountered:
I simplified my code as follow, I was expecting to create a dictionary from another, but it fails.
actual := TCounter.Create(expected);
raise a compiling error.dictionarytest.pas(12,37) Error: Incompatible type for arg no. 1: Got "TDictionary<System.Char,System.LongInt>", expected "TEnumerable<dictionarytest.TPair<System.Char,System.LongInt>>"
I dug some source code, but it is too complex to find the inheritance of TDictionary class.
Please help, if I took something wrong.
The text was updated successfully, but these errors were encountered: