Re: [fpc-pascal] Interface Inheritance Bug

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

> Am 19.03.2017 05:07 schrieb "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 LongInt>""
>
> I think this will happen with non-generic interfaces as well. So please
> test with those and if possible also with 3.1.1 and report a bug if
> necessary (preferable with a non-generic example, makes things easier to
> debug ;) ).
>
>
Bug confirmed on 3.1.1.
Issued as http://bugs.freepascal.org/view.php?id=31568.


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

Re: [fpc-pascal] Interface Inheritance Bug

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

> But without the cast you get the same error, yes?
>
> Regards,
> Sven
>
>
Yes, i need to cast.

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

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 17:55 schrieb "African Wild Dog" :
>
> 2017-03-19 5:25 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:
>>
>> I think this will happen with non-generic interfaces as well. So please
test with those and if possible also with 3.1.1 and report a bug if
necessary (preferable with a non-generic example, makes things easier to
debug ;) ).
>
>
> With non-generic types there is a workaround: cast to parent interface:
>
> ...
>
> ParentImplementorInstance := TImplementor.Create as IParentInterface;

But without the cast you get the same error, yes?

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

Re: [fpc-pascal] Interface Inheritance Bug

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

> I think this will happen with non-generic interfaces as well. So please
> test with those and if possible also with 3.1.1 and report a bug if
> necessary (preferable with a non-generic example, makes things easier to
> debug ;) ).
>
>
With non-generic types there is a workaround: cast to parent interface:

...

ParentImplementorInstance := TImplementor.Create as IParentInterface;

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

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 05:07 schrieb "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""

I think this will happen with non-generic interfaces as well. So please
test with those and if possible also with 3.1.1 and report a bug if
necessary (preferable with a non-generic example, makes things easier to
debug ;) ).

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