Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-03

Generics Bug

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

African Wild Dog

Hello,

Please confirm this bug.

The unit code bellow won't compile (fpc 3.0.2 - debian jessie amd64):

"generics_bug.pas(17,48) Fatal: Syntax error, "," expected but "<" found"

=== CODE ===

*unit* generics_bug;
{$mode delphi}

*interface*

*type*

  TPair<TKey, TValue> = *record*
    Key: TKey;
    Value: TValue;
  *end*;
  TEnumerator<T> = *class*
  *end*;
  TGenericClass<T, K> = *class*(TEnumerator<TPair<T, K>>)
  *end*;

*implementation*

*end*.

===

This code compiles in Delphi XE 2.

Regards

Reply by email

Sven Barth
to African Wild Dog
"African Wild Dog" wrote 36 lines
Hello, Please confirm this bug. The unit code bellow won't compile (fpc 3.0.2 - debian jessie amd64): "generics_bug.pas(17,48) Fatal: Syntax error, "," expected but "<" found" === CODE === unit generics_bug; {$mode delphi} interface type TPair<TKey, TValue> = record Key: TKey; Value: TValue; end; TEnumerator<T> = class end; TGenericClass<T, K> = class(TEnumerator<TPair<T, K>>) end; implementation end. ===

Nested specializations are currently not supported though they *might* work with 3.1.1.

Regards,
Sven

Reply by email

Sven Barth
to Sven Barth
"Sven Barth" wrote 11 lines
Am 18.03.2017 19:55 schrieb "African Wild Dog" : > > Hello, > > > Please confirm this bug. > > The unit code bellow won't compile (fpc 3.0.2 - debian jessie amd64): > > "generics_bug.pas(17,48) Fatal: Syntax error, "," expected but "<"

found"

Show quoted text 29 lines
> > === CODE === > > unit generics_bug; > > {$mode delphi} > > interface > > type > > TPair<TKey, TValue> = record > Key: TKey; > Value: TValue; > end; > > TEnumerator<T> = class > end; > > TGenericClass<T, K> = class(TEnumerator<TPair<T, K>>) > end; > > implementation > > end. > > === Nested specializations are currently not supported though they *might*

work with 3.1.1.

Note: "they" in the sense of "this specific case".

Regards,
Sven

Reply by email

African Wild Dog
to African Wild Dog

2017-03-18 19:29 GMT-03:00 African Wild Dog :

Show quoted text 11 lines
2017-03-18 18:41 GMT-03:00 Sven Barth via fpc-pascal < >: Nested specializations are currently not supported though they *might* > work with 3.1.1. > I will do test some tests with 3.1.1. Thanks. Regards

I have tested with 3.1.1. Nested specializations works in 3.1.1.

Regards

Reply by email