Identifier problem? (Delphi)

1

The error is as follows:

  

identifier not found TDato2


{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

type
    TDato1 = class
        campo1: string;
        campo2: string;

        dato2: TDato2;
    end;

    TDato2 = class(TDato1)
        campo3: byte;
        campo4: string;

        dato1: TDato1;
    end;

implementation

end.

    
asked by Paolo 15.07.2016 в 23:53
source

1 answer

1

I already solved it, I just had to redefine the class.


{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

type
    TDato2 = class;

    TDato1 = class
        campo1: string;
        campo2: string;

        dato2: TDato2;
    end;

    TDato2 = class(TDato1)
        campo3: byte;
        campo4: string;

        dato1: TDato1;
    end;

implementation

end.

    
answered by 16.07.2016 / 03:41
source