Jump to content
GPRSNerd

CCR.EXIF: Rio throws E2574

Recommended Posts

Hi,

 

I'm trying to get my components, packages and units running under Delphi 10.3 Rio.

 

Currently I'm stumbling over CCR.EXIF (latest revision 1.5.1), the set of units to read and manipulate EXIF header data and such in images.

The compiler throws a E2574 in the unit CCR.Exif.IPTC.pas at this place:

unit CCR.Exif.IPTC;

interface

uses
  Types, SysUtils, Classes, {$IFDEF HasGenerics}Generics.Collections, Generics.Defaults,{$ENDIF}
  {$IFDEF VCL}Jpeg,{$ENDIF} CCR.Exif.BaseUtils, CCR.Exif.TagIDs, CCR.Exif.TiffUtils;

type

  TIPTCStringArray = type Types.TStringDynArray; //using 'type' means the helper defined below will only apply to it

  {$IFDEF XE3+}
  TIPTCStringArrayHelper = record helper for TIPTCStringArray
    class function CreateFromStrings(const Strings: TStrings): TIPTCStringArray; static;
    function Join(const Separator: string): string;
  end;
  {$ENDIF}

In line 11 of this excerpt the compiler throws a E2574 ("Instantiated type can not be used for TYPE'd type declaration") about the use of "type" for this declaration of TIPTCStringArray, which shall extent TStringDynArray with a recordhelper.

This error doesn't occur with any compiler prior to Rio.


When I leave out the "type" it compiles fine.

I'm not an expert on generics and such, so I'm not sure what consequences it has to just leave out the "type" (in contrary to the authors intent according to the comment).

 

Has anyone a better idea what to do here?

Edited by GPRSNerd

Share this post


Link to post

I've solved it so far by using the orginal type declaration for compilers >= Rio.

It might not be the most elegant solution, but it keeps up the spirit of the original code (I hope).

{$IF CompilerVersion >= 33}
  {$DEFINE GenericTStringDynArray}
{$IFEND}

 

  TIPTCStringArray = {$IFDEF GenericTStringDynArray} Array of String {$ELSE} type Types.TStringDynArray {$ENDIF}; //using 'type' means the helper defined below will only apply to it
Quote

 

<OT> How to get rid of the empty quote object? </OT>

Edited by GPRSNerd
  • Like 1

Share this post


Link to post
On 11/30/2018 at 11:02 PM, GPRSNerd said:

<OT> How to get rid of the empty quote object? </OT>

When you edit your post, just place the cursor before the <OT> then press Backspace (<-) till the empty quote is gone.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×