zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
449 stars 86 forks source link

Can't seem to access a member of a base class #56

Closed daveyostcom closed 5 years ago

daveyostcom commented 5 years ago

See evalDemo5() in my example code.

JonathanMagnan commented 5 years ago

Hello @daveyostcom ,

I believe this one is an expected behavior.

Your member of base class is currently private. Which mean, you cannot access it from child.

You need to set it either public or protected

class HolderBase {
    public int valueBase = 16;
}

// or

class HolderBase {
    protected int valueBase = 16;
}

Let me know if that's now working as expected.

Best Regards,

Jonathan

daveyostcom commented 5 years ago

Silly me!

Sorry for the bother.