Recent

Author Topic: [generics] Error: Type identifier expected  (Read 3322 times)

Neuromancer

  • New Member
  • *
  • Posts: 44
    • My personal website
[generics] Error: Type identifier expected
« on: July 23, 2016, 08:04:14 pm »
Hello,

The following code fails :

Code: Pascal  [Select][+][-]
  1. {$mode delphi}{$H+}
  2.  
  3. interface
  4.  
  5. uses
  6.     Classes, SysUtils, Dictionary;
  7.  
  8. type
  9.     TStringDictionary = TDictionary<string, string>;
  10.  
  11. implementation
  12.  
  13. var
  14. Catalog : TDictionary<string, TStringDictionary>;
  15.  
  16. initialization
  17. Catalog := TDictionary<string, TStringDictionary>.Create;
  18.  
  19. finalization
  20. Catalog.free;
  21.  
  22. end.    

unit2.pas(19,49) Error: Type identifier expected

Should not it work in delphi mode ?

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: [generics] Error: Type identifier expected
« Reply #1 on: July 23, 2016, 08:24:58 pm »
It doesn't even work in Delphi itself? (I quickly tested with XE2) ;) So? Compared to which Delphi version do you expect that code to work?
Specialize a type, not a var.

 

TinyPortal © 2005-2018