Page MenuHomeFeedback Tracker

Adding 'private' access modifier to destructor prevents marking variable as ref within the same class
Closed, ResolvedPublic

Description

The example code attached no longer compiles in 1.16. It used to compile in 1.15. Removing the private access modifier from the destructor allows it to compile but then opens up the script to be referenced counted and deleted outside of the desired bounds.

class SomeClass
{
    private static ref SomeClass s_Singleton;
        
    private void SomeClass();
    private void ~SomeClass();
    
    static void Init()
    {
        s_Singleton = new SomeClass();
    }
    
    static void Destroy()
    {
        s_Singleton = null;
    }
    
    static SomeClass Get()
    {
        return s_Singleton;
    }
};

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

Jacob_Mango renamed this task from Adding 'private' access modifier to destructor prevents marking variable as ref within instance to Adding 'private' access modifier to destructor prevents marking variable as ref within the same class.Jan 28 2022, 10:56 AM
Jacob_Mango updated the task description. (Show Details)
MarioE added a subscriber: MarioE.Jan 28 2022, 11:04 AM
Geez changed the task status from New to Assigned.Jan 28 2022, 12:46 PM
Geez changed the task status from Assigned to Acknowledged.Jan 28 2022, 12:52 PM
Geez added a subscriber: Geez.

Thank you for the report Jacob_Mango.
We are going to look into fixing the problem as soon as possible.
Regards,
Geez

Geez closed this task as Resolved.Feb 18 2022, 2:54 PM
Geez claimed this task.

Hello again.
The issue has been fixed internally and the fix will appear in one of the upcoming updates.
Regards,
Geez