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

Ensure that isinteractive multi-emit backing fields are not public #17438

Closed
KevinRansom opened this issue Jul 23, 2024 · 1 comment · Fixed by #17439
Closed

Ensure that isinteractive multi-emit backing fields are not public #17438

KevinRansom opened this issue Jul 23, 2024 · 1 comment · Fixed by #17439

Comments

@KevinRansom
Copy link
Member

KevinRansom commented Jul 23, 2024

dotnet interactive multiemit**+** previously made the backing fields for records, unions, E.t.c public, whereas multiemit**-** makes them internal.

Some poorly written serializers, include public fields specified with a CompilerGeneratedAttribute in the serialization stream.

This means that multiemit**-** has become a work around in scenarios that rely on fsi and serialization using these types of serializers.

This PR fixes the problem by correctly specifying fields as Private (actually internal). As implementation details they are also internal when compiled with realsig**+**

I believe the original reason for making the backing field public was so that fsi could reliably access it from multi-emit assemblies. Due to implementation issues there was previously a limit of 30 internal visible following assemblies. Now that it has been corrected, all multi-emit assemblies in a session have internals visible so, making the fields internal should work correctly.

Background:
@Szer

#17308 (comment)

@Szer
Copy link
Contributor

Szer commented Jul 24, 2024

That makes a lot of sense, thank you @KevinRansom

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

Successfully merging a pull request may close this issue.

2 participants