Generics Bug

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Generics Bug

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generics Bug

Free Pascal - General mailing list

Am 18.03.2017 19:55 schrieb "African Wild Dog" <[hidden email]>:
>
> 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


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generics Bug

Free Pascal - General mailing list

Am 18.03.2017 22:41 schrieb "Sven Barth" <[hidden email]>:
>
> Am 18.03.2017 19:55 schrieb "African Wild Dog" <[hidden email]>:
> >
> > 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.

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

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generics Bug

African Wild Dog
In reply to this post by Free Pascal - General mailing list
2017-03-18 18:41 GMT-03:00 Sven Barth via fpc-pascal <[hidden email]>:

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generics Bug

African Wild Dog
2017-03-18 19:29 GMT-03:00 African Wild Dog <[hidden email]>:
2017-03-18 18:41 GMT-03:00 Sven Barth via fpc-pascal <[hidden email]>:

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


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Loading...