diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-incompatible-destructuring-kinds.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-incompatible-destructuring-kinds.expect.md new file mode 100644 index 0000000000..cd038eff52 --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-incompatible-destructuring-kinds.expect.md @@ -0,0 +1,35 @@ + +## Input + +```javascript +import { useMemo } from "react"; +import { Stringify } from "shared-runtime"; + +function Component({}) { + let a = "a"; + let b = ""; + [a, b] = [null, null]; + return a} />; +} + +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [{}], +}; + +``` + + +## Error + +``` + 5 | let a = "a"; + 6 | let b = ""; +> 7 | [a, b] = [null, null]; + | ^ [ReactForget] Invariant: Expected consistent kind for destructuring. Other places were 'Const' but 'store b$36[10:12]' is reassigned (7:7) + 8 | return a} />; + 9 | } + 10 | +``` + + \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-incompatible-destructuring-kinds.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-incompatible-destructuring-kinds.js new file mode 100644 index 0000000000..80ec7e3526 --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-incompatible-destructuring-kinds.js @@ -0,0 +1,14 @@ +import { useMemo } from "react"; +import { Stringify } from "shared-runtime"; + +function Component({}) { + let a = "a"; + let b = ""; + [a, b] = [null, null]; + return a} />; +} + +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [{}], +};