Compilation problem: Logical expressions and coalesce expressions cannot be mixed.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 26.3k
- Forks
- 1.8k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 20
Description
resolvedParams.pcodeParams.darkTheme = pcodeParams.darkTheme ?? (window.Ya && window.Ya.skin === 'dark');
Hey Guys!
I am getting parse error saying "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses".
But it does not seem to be a straightforward mix, we do have parentheses.
When I get rid of ?? by optional chaining, it does compile fine.
I could not replicate it with repl, or somewhere else, that's why reporting here.
rollup 3.28
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the reported assignment as the initial reproduction case in Rollup 3.28, then investigate the parser path for the reported parse error. Confirm the behavior with the shown logical and coalesce expression, and consider the issue done when the valid parenthesized expression compiles without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100