Skip to content

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

Description

@KevinRansom

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)

Activity

  1. added this to the Backlog milestone on Jul 23, 2024
  2. Szer commented on Jul 24, 2024

    @Szer
    Contributor

    That makes a lot of sense, thank you @KevinRansom

  3. added a commit that references this issue on Jul 30, 2024
    f6d21c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions