-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Unions generate code that is not C#7 compliant #304
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a library that uses C#8 and targets the .net 2.1 standard framework. One of the serialized types is abstract, so I've implemented it as a union in MemoryPack.
MemoryPackGenerator.Emitter.cs generates the following code:
This code causes the compiler to emit the error:
A google search of this error message suggests that the issue is the new key word without a corresponding object type after the new.
I believe this problem can be fixed in the source generator by changing line 1092 from:
to
I'm going to look into creating a PR with a fix for this, but I've never contributed to an OSS project before, so it may take me some time to figure out how to do so.
The text was updated successfully, but these errors were encountered: