Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultFileText doesn't work when the DataFile is created via field initializer #8

Closed
JimmyCushnie opened this issue Mar 11, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@JimmyCushnie
Copy link
Owner

JimmyCushnie commented Mar 11, 2019

I am pretty sure this is a compiler bug. It happens in the standalone c# version, but it does not happen with the Unity version.

static class Test
{
    // this creates an empty file
    static DataFile file = new DataFile("test"), defaultFileText: "# this is a test");

    static void Main()
    {
        // this creates a file with the text "# this is a test"
        var file = new DataFile("test2", defaultFileText: "# this is a test");
    }
}

I have found through testing that the defaultFileText variable is being set to null before it reaches the constructor method.

@JimmyCushnie
Copy link
Owner Author

Okay, never mind, this is only happening within the SUCC.Tests project. What the hell

@JimmyCushnie JimmyCushnie added the bug Something isn't working label Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant