Okay with the latest trunk version I tried compiling my generic classes. It
seems there is a problem with fpc generics in that you cannot use a generic
as a type parameter. e.g type TDictionary<K,V> =
class(TEnumerable<TPair<K,V>>) ...

Given:

type
  TCollection<T> = class
  end;

  TPair<K,V> = class
    Key: K;
    Value: V;
  end;

// Test

var
  TestA: TCollection<TPair<String,Integer>>; // Fatal: Syntax error, ","
expected but "<" found
  TestB: TCollection<String>; // Okay

The same problem occurs with classes

type
  TDictionaryA<K,V> = class(TCollection<TPair<K,V>>)  // Fatal: Syntax
error, "," expected but "<" found
  end;
  TDictionaryB<K,V> = class(TCollection<Integer>)  // Okay
  end;
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to