CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
347 stars 83 forks source link

Fix generated code problems with nullable primitive return values #386

Closed kring closed 8 months ago

kring commented 9 months ago

As a test, I added the following to Runtime/Helpers.cs:

public static bool? TestThing()
{
    return null;
}

And the following to Runtime/ConfigureReinterop.cs:

Helpers.TestThing();

Reinterop generated invalid code for this. After this PR, the code is generated correctly. We previously handled nullable blittable structs, but not nullable primitives.

j9liu commented 8 months ago

This works well on my upgrade-feature-metadata branch so I'm going to merge. Thanks @kring !