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

Private nullable fields added at runtime cause errors (only for reference type) #37

Open
handzlikchris opened this issue Apr 5, 2023 · 2 comments

Comments

@handzlikchris
Copy link
Owner

Having an issue Added private nullable field and got error during compilation CS8639: The typeof operator cannot be used on a nullable reference type' Related generated line: private static Dictionary<string, System.Func> __Patched_NewFieldsToGetTypeFnDictionaryFieldName = new() {["kitchenObject"] = () => typeof(KitchenObject? ), }; (edited)

@handzlikchris handzlikchris added the bug Something isn't working label Apr 5, 2023
@handzlikchris
Copy link
Owner Author

user has to enable null explicitly for those via #nullable enable at top of the script

@handzlikchris
Copy link
Owner Author

potentiall when explicit #nullable enable is used, reference types should be rewritten to typeof(type) for initialization and value types should remain typeof(type?) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant