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

Add note about IsExternalInit #125

Open
RReverser opened this issue Jan 6, 2025 · 1 comment
Open

Add note about IsExternalInit #125

RReverser opened this issue Jan 6, 2025 · 1 comment

Comments

@RReverser
Copy link
Member

Some of the newer C# features are supported by Unity compiler, but require symbols from newer .NET that Unity doesn't have.

One notable feature that we rely on a lot and that users run into is init-only properties - either implicit as part of record declarations, or explicit ones like MyType MyProp { get; init; }.

This compiles fine in Unity, but complains about missing System.Runtime.CompilerServices.IsExternalInit symbol. The issue is pretty googlable, is mentioned in the Unity docs and the required fix is just for the user to add

namespace System.Runtime.CompilerServices
{
    internal static class IsExternalInit { }
}

to their own project (the one with our generated C# files), but we need to add this to our C# docs for better visibility as well.

@cloutiertyler
Copy link
Contributor

What does it mean that we "rely on it a lot"? I think this would have to rise to a pretty substantial amount of need to pay for the cost of confusing new users or causing frustration for users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants