[fpc-pascal] Interface Inheritance Bug

2017-03-18 Thread African Wild Dog
Hello,

Test env: debian jessie amd64 - fpc 3.0.2

It seems free pascal have a bug when handling interface inheritance using
generics.

When i try to compile the unit bellow, i get this error:

"interface_bug.pas(41,44) Error: Incompatible types: got
"TImplementor" expected "IParentInterface""


=== CODE ===

*unit* interface_bug;

{$mode delphi}

*interface*

*type*

  IParentInterface = *interface*
['{0F78D56E-85A6-4024-98D7-720D7C7B9573}']
*procedure* Foo;
  *end*;

  IChildInterface = *interface*(IParentInterface)
['{1AB2EB85-6843-462E-8CE4-32ECC065011E}']
*procedure* Bar;
  *end*;

  TImplementor =  class(TInterfacedObject, IChildInterface)
  *public*
*procedure* Foo;
*procedure* Bar;
  *end*;

*var*
  ParentImplementorInstance: IParentInterface;

*implementation*

*procedure* TImplementor.Foo;
*begin*

*end*;

*procedure* TImplementor.Bar;
*begin*

*end*;

*initialization*
  ParentImplementorInstance:=TImplementor.Create;

*end*.


===
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-18 Thread Bart
On 3/18/17, Sven Barth via fpc-pascal  wrote:

> Forward declarations for generic types are not supported.

But it should not give an internal error.

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generics Bug

2017-03-18 Thread African Wild Dog
2017-03-18 18:41 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:

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  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-18 Thread African Wild Dog
2017-03-18 18:40 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:

> Forward declarations for generic types are not supported.
>
> Are there plans for add suport for this in fpc 3.2?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generics Bug

2017-03-18 Thread Sven Barth via fpc-pascal
Am 18.03.2017 22:41 schrieb "Sven Barth" :
>
> 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"
> >
> > === CODE  ===
> >
> > unit generics_bug;
> >
> > {$mode delphi}
> >
> > interface
> >
> > type
> >
> >   TPair = record
> > Key: TKey;
> > Value: TValue;
> >   end;
> >
> >   TEnumerator = class
> >   end;
> >
> >   TGenericClass = class(TEnumerator>)
> >   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  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generics Bug

2017-03-18 Thread Sven Barth via fpc-pascal
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"
>
> === CODE  ===
>
> unit generics_bug;
>
> {$mode delphi}
>
> interface
>
> type
>
>   TPair = record
> Key: TKey;
> Value: TValue;
>   end;
>
>   TEnumerator = class
>   end;
>
>   TGenericClass = class(TEnumerator>)
>   end;
>
> implementation
>
> end.
>
> ===

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

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-18 Thread Sven Barth via fpc-pascal
Am 18.03.2017 19:20 schrieb "African Wild Dog" :
>
> Hello,
>
> Please confirm if this is a bug.
>
> When I try to compile the unit below I get the error:
>
> "generics_bug.pas(14,43) Fatal: Internal error 2012101001"
>
> It seems the compiler has bug when handling forward generics declaration.

Forward declarations for generic types are not supported.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Generics Bug

2017-03-18 Thread 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 = *record*
Key: TKey;
Value: TValue;
  *end*;

  TEnumerator = *class*
  *end*;

  TGenericClass = *class*(TEnumerator>)
  *end*;

*implementation*

*end*.

===


This code compiles in Delphi XE 2.

Regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.OnTerminate ?

2017-03-18 Thread fredvs
>  (or I miss something).

Yes, new glasses.

Sorry for the noise,

Fre;D



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/TThread-OnTerminate-tp5727888p5727890.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.OnTerminate ?

2017-03-18 Thread Michael Van Canneyt



On Sat, 18 Mar 2017, fredvs wrote:


Hello.

Does it exist a equivalent of the Delphi TThread.OnTerminate ?
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Classes_TThread_OnTerminate.html

I do not see it in fpc (or I miss something).


You miss it. It exists and it is even documented:
http://www.freepascal.org/docs-html/current/rtl/classes/tthread.onterminate.html


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Forward Generic Type Declaration Bug

2017-03-18 Thread African Wild Dog
Hello,

Please confirm if this is a bug.

When I try to compile the unit below I get the error:

"generics_bug.pas(14,43) Fatal: Internal error 2012101001"

It seems the compiler has bug when handling forward generics declaration.

Tested on: Debian Jessie amd64 - fpc 3.0.2

=== CODE ===

*unit* generics_bug;

{$mode delphi}

*interface*


*type*

  IGenericInterface = *interface*; // Forward

  TGenericClass = *class*
  *private*
FGenericInterface: IGenericInterface;
  *end*;

  IGenericInterface = *interface*
  *end*;


*implementation*

*end*.

===


Regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] TThread.OnTerminate ?

2017-03-18 Thread fredvs
Hello.

Does it exist a equivalent of the Delphi TThread.OnTerminate ?
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Classes_TThread_OnTerminate.html

I do not see it in fpc (or I miss something).

Thanks

Fre;D



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/TThread-OnTerminate-tp5727888.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal