ghkweon / dwscript

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

Storing MethodSymbol in TInternalBaseMethod #358

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the TInternalBaseMethod constructor, the TMethodSymbol for the method is 
created and stored in a local variable. Could this be stored in the FFuncSymbol 
field from it's parent class instead? Or in a new FMethodSymbol field if 
possible?

This would be very convenient for adding getters/setters to properties.

Example:
TMyMethod = class(TInternalBaseMethod);

...

Prop := TPropertySymbol.Create(...);
Prop.ReadSym := TMyMethod.Create(...).FuncSymbol;

Original issue reported on code.google.com by frederic...@gmail.com on 7 Apr 2013 at 12:45

GoogleCodeExporter commented 8 years ago
After running a quick test, I've found that FuncSymbol doesn't store anything 
in TInternalBaseMethod. Storing the TMethodSymbol in FFuncSymbol shouldn't be a 
problem then. The same thing can be said for TInternalRecordMethod. I've 
attached a patch file.

Original comment by frederic...@gmail.com on 7 Apr 2013 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1896.

Original comment by zar...@gmail.com on 8 Apr 2013 at 10:04

GoogleCodeExporter commented 8 years ago

Original comment by zar...@gmail.com on 8 Apr 2013 at 3:59