SomeRanDev / reflaxe

Haxe framework for creating compilation targets using macros
MIT License
91 stars 4 forks source link

The method to get default value of private non static class variable. #3

Closed vega0 closed 8 months ago

vega0 commented 1 year ago

Question as in title.

Look: image

SomeRanDev commented 1 year ago

Haxe can be weird. It automatically removes the default value from ClassField and assigns it in the constructor. I'll see if I can make a helper function to extract or find the default value! 👌

vega0 commented 1 year ago

ok, thx.

SomeRanDev commented 1 year ago

Hello! I have added the following functions to ClassVarData:

public function hasDefaultValue(): Bool;
public function getDefaultUntypedExpr(): Null<Expr>;
public function findDefaultExpr(): Null<TypedExpr>;

I hope this helps!

vega0 commented 1 year ago

Hello! I have added the following functions to ClassVarData:

public function hasDefaultValue(): Bool;
public function getDefaultUntypedExpr(): Null<Expr>;
public function findDefaultExpr(): Null<TypedExpr>;

I hope this helps!

is it possbile to create Class statement object? for statements valker.

SomeRanDev commented 1 year ago

Sorry, I don't understand the question. 😢 What is "Class statement object"?

SomeRanDev commented 8 months ago

(Closing due to inactivity)