renan-guimaraes / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Delphi-side class with public setter/getter and register it via RTTI #394

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have in Delphi code class like:

  TTestClass = class
   private
    fSomeProperty: Integer;
   protected
    function GetSomeProperty: Integer;
    procedure SetSomeProperty(const Value: Integer);
   public
    property SomeProperty: Integer read GetSomeProperty write SetSomeProperty;
  end;

In FormCreate event I register this class by RTTI:

  dwsuUnit.ExposeRTTI(TypeInfo(TTestClass),[eoNoFreeOnCleanup, eoExposePublic]);

Then compile the script (any) and is okay. I can use this class.

But when I move the setter declaration from protected to the public section:
[...]
 public
  procedure SetSomeProperty(const Value: Integer);
[...]

and compile, I get the following error:

Syntax Error: TdwsUnit: "MyUnit" -- TdwsClass: "TTestClass" -- TdwsMethod: 
"SetSomeProperty" -- Name "SetSomeProperty" already exists.

Original issue reported on code.google.com by jac....@gmail.com on 15 May 2013 at 1:31