talpa / delphi-orm

Automatically exported from code.google.com/p/delphi-orm
0 stars 0 forks source link

Error in the compilation of the project DORM_UnitTest.dpr for XE2 #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I found an error in the compilation of the project DORM_UnitTest.dpr for XE2

When I try to compile I get an error Incompatible type TPerson and TObject

I checked and found that the procedure that creates problems is the following.

Commenting on the highlighted line with>>> the project is compiled.

procedure TTestDORM.TestFindOne;
var
  p: TPerson;
  p1: TPerson;
begin
  p := TPerson.NewPerson;
  try
    Session.Persist(p);
>>>    p1 := Session.FindOne<TPerson>(TdormCriteria.NewCriteria('ID',
>>>      TdormCompareOperator.coEqual, p.id));
    try
      CheckEquals(p.id, p1.id); // same data
      CheckFalse(p = p1); // different objects
    finally
      p1.Free;
    end;
  finally
    p.Free;
  end;
end;

Original issue reported on code.google.com by mottadel...@gmail.com on 3 Jan 2012 at 11:39

GoogleCodeExporter commented 9 years ago
This error occurred on Delphi XE2 update pack1. 
The problem does not occur on XE2 Delphi update pack 3.

Original comment by mottadel...@gmail.com on 4 Jan 2012 at 10:38