Page MenuHomeFeedback Tracker

Enscript class variables with function invokes ... I really don't know
Assigned, UrgentPublic

Description

While it is questionable to use a function invoke to assign a variable on class creation. It's working so let's assume that valid for now.
This does create a compile error when used in the setup below.

class TestBaseClass
{
    private string m_BaseVariable = m_BaseFnc();

    private string m_BaseFnc()
    {
        return "Hello World";
    };

    void Hello()
    {
    };
};

class TestSubClass: TestBaseClass
{
    private void SomeFunctionInSubClass()
    {
    };

    override void Hello()
    {
        SomeFunctionInSubClass(); //ERROR ON THIS LINE -> Should be visible since it is within the same class but it is not.
    };
};
---------------------------
Compile error
---------------------------
Can't compile "Mission" script module!

myScript.c(23): Method 'SomeFunctionInSubClass' is private
---------------------------

Either you do not allow the base class to even compile, or you lookup why the subclass is behaving this way. It's a stupid code example ... but there is a bug / missing implementation regardless

UPDATE: It also fails with a less convoluted example

class TestBaseClass
{
    bool m_BaseVariable = true; //**WITHOUT** the true assignment it works. So this seems to trigger the issue somehow.

    void Hello()
    {
    };
};

class TestSubClass: TestBaseClass
{
    private void SomeFunctionInSubClass()
    {
    };

    override void Hello()
    {
        SomeFunctionInSubClass(); //ERROR ON THIS LINE -> Should be visible since it is within the same class but it is not.
    };
};

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Additional Information

Please forward to Enfusion team.

Event Timeline

Arkensor created this task.Sep 11 2020, 5:21 PM
Arkensor updated the task description. (Show Details)Sep 12 2020, 11:57 AM
Arkensor updated the task description. (Show Details)Sep 12 2020, 11:59 AM
Geez changed the task status from New to Assigned.Sep 14 2020, 1:17 PM