Browse Source

+ Commit test for bug #27044.

git-svn-id: trunk@29110 -
sergei 10 years ago
parent
commit
3f2022cba7
2 changed files with 29 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 28 0
      tests/test/units/variants/tw27044.pp

+ 1 - 0
.gitattributes

@@ -12561,6 +12561,7 @@ tests/test/units/sysutils/twstrcmp.pp svneol=native#text/plain
 tests/test/units/ucomplex/tcsqr1.pp svneol=native#text/pascal
 tests/test/units/variants/tcustomvariant.pp svneol=native#text/plain
 tests/test/units/variants/tvararrayofintf.pp svneol=native#text/plain
+tests/test/units/variants/tw27044.pp svneol=native#text/plain
 tests/test/uobjc24.pp svneol=native#text/plain
 tests/test/uobjc26.pp svneol=native#text/plain
 tests/test/uobjc27a.pp svneol=native#text/plain

+ 28 - 0
tests/test/units/variants/tw27044.pp

@@ -0,0 +1,28 @@
+{ %norun }
+{ Test that invoking methods on Variant that are function results, etc. 
+  compiles without errors. }
+{$mode delphi}{$H+}
+
+uses SysUtils,variants;
+
+type
+  TTest = class
+  private
+   FObj: IDispatch;
+   function GetObj: OleVariant;
+  public
+   property Obj: OleVariant read GetObj;
+  end;
+
+var tst: TTest;
+
+function TTest.GetObj: OleVariant;
+begin
+  Result := FObj;
+end;   
+
+begin
+  variant(0).foo;
+  tst.Obj.bar;
+end.
+