MerlinVR / UdonSharp

An experimental compiler for compiling C# to Udon assembly
MIT License
669 stars 88 forks source link

Nullpo with conditional expression #133

Closed ikuko closed 2 years ago

ikuko commented 2 years ago

A null reference occurs when I write the following U# code

It seems that it has been fixed locally by Merlin, but since there are many people around me who are having trouble with this problem, I will post a PR for sharing. I don't think this PR will be merged. Close when no longer needed

public class test15 : UdonSharpBehaviour
{
    private void Start()
    {
        enabled = true ? true : val;
    }

    public bool val => true;
}