Skip to content

fix: lower void conditionals as statements - #72

Open
CooperSheroy wants to merge 1 commit into
vercel-labs:mainfrom
CooperSheroy:catalina/void-conditional-arrow-20260801
Open

fix: lower void conditionals as statements#72
CooperSheroy wants to merge 1 commit into
vercel-labs:mainfrom
CooperSheroy:catalina/void-conditional-arrow-20260801

Conversation

@CooperSheroy

Copy link
Copy Markdown

Summary

Fixes #33 by lowering void-position conditional expressions as statements instead of emitting a void-valued IR ternary.

This covers concise void-returning arrow bodies such as:

const pick = () => cond ? a() : b();

and also statement-position conditionals, preserving lazy branch evaluation while respecting the existing IR invariant that ternary is value-typed.

Validation

  • pnpm install --frozen-lockfile
  • pnpm build
  • pnpm exec vitest run tests/harness/differential.test.ts -t 2352-void-coercions
  • pnpm lint
  • git diff --check

Note: this host is on Node v22.22.2, so pnpm printed the repository engine warning for Node >=24. The commands above still completed successfully.

@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

@CooperSheroy is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SC9001 internal compiler error: 'ternary must not be void' for an arrow body over two void calls

1 participant