Skip to content

Conversation

@pCYSl5EDgo
Copy link
Contributor

@pCYSl5EDgo pCYSl5EDgo commented Dec 26, 2021

Background

MPC now allows C#10.
C#10 introduced global using.

Problem

It causes name collisions.
To avoid those collisions mpc generated code must not use using at all.

Solution

Remove using directives from mpc templates.

Add new API byte[]? MessagePackReader.ReadByteArray()

MessagePackReader reader;
reader.ReadBytes()?.ToArray();

The current behaviour is the above.
It uses byte[] System.Buffers.BuffersExtensions.ToArray(ReadOnlySequence<byte>) extension method.
It cannot handle Nullable<ReadOnlySequence<byte>> well.

@pCYSl5EDgo pCYSl5EDgo marked this pull request as ready for review December 26, 2021 09:50
@pCYSl5EDgo
Copy link
Contributor Author

I have a question.

Does the reviewer actually read the cs files generated by T4 runtime template?

The people who use not en-us culture Visual Studio must rewrite the generated code...
This is very boring task and sometimes I left it behind accidentally.

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'm delighted that so few changes were necessary in the generated code templates to resolve the issue.

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

Successfully merging this pull request may close these issues.

2 participants