Skip to content

[Compiler Bug]: new mutation aliasing model incorrectly detects a frozen value mutation when mutating a set created via passing the set constructor a frozen value #33614

Closed
@deivshon

Description

@deivshon

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgdgQwEYBsEByCA7gLJQAumFAlhOgIK42Zg3oDmpEAJgrsgowoCADrpxNALYAHCDAoACYIqhgEAZSoUEigL6KAZjAhTFokDASY4FC5NnylK8rlob+CW-qMmzFgDoAgHooGmCpKDcadXxbCKjaWK87EHFxBAAPOQVFOHowJQYZGUUAXkUACgBKcoA+ZXFFPIKlAG1k2wQeABpFdQoPOJ0eAF1y1XUtagRK9BJFDyUAHn6hdg5FBprqppb0QsV6IZTugGEAC0xOXQrKgDdMXBFkNZgN2rKG4D3m-IOlPNiCcujwJkDFggKJVOiNduhms0aIYqkCQSMAlcwA8niJqrUfgjEc00Z5QQE+PgdDjngh4cSDPx1I0icTScNugFMDweDS8b99AKBujunMSCKePTBRIiVYKLAEctXO4yUpYd0ysB1TwDMdVecrjdNXqOTxLtcOAgDME6uI9OIQHogA

Repro steps

  1. In an event handler, create a Set by passing the Set constructor a frozen value like a piece of state or a prop (i.e. const derivedSet = new Set(frozen))
  2. Mutate it by deleting/adding an element

How often does this bug happen?

Every time

What version of React are you using?

19.1

What version of React Compiler are you using?

6c7b1a1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions