Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Explicit casting may not work. #115

Open
ikuko opened this issue Sep 7, 2021 · 1 comment
Open

Explicit casting may not work. #115

ikuko opened this issue Sep 7, 2021 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@ikuko
Copy link

ikuko commented Sep 7, 2021

Describe the bug in detail:
It was not cast in the generated UASM even though I explicitly instructed it to cast.
It is possible to work around this by going through temporary variables, but the behavior doesn't match and it feels strange.

Provide steps/code to reproduce the bug:

public class Example : UdonSharpBehaviour
{
    private void Start()
    {
        var color32 = new Color32();
        var obj = (object)color32;

        // Udon=OK C#=OK
        var arg = (Color32)obj;
        Method(arg);

        // Udon=NG C#=OK
        Method((Color32)obj);
    }

    void Method(Color color)
    {
        Debug.Log($"{color}");
    }
}

Expected behavior:
Should behave the same as C#.

Additional Information:
Provide any additional information here.

@ikuko ikuko added the bug Something isn't working label Sep 7, 2021
@MerlinVR
Copy link
Owner

MerlinVR commented Sep 7, 2021

This is resolved in 1.0.

@MerlinVR MerlinVR added this to the UdonSharp 1.0 milestone Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants