Skip to content

refactor(transform): report unsupported translation by sentinel - #351

Merged
siyul-park merged 2 commits into
mainfrom
refactor/translate-unsupported
Nov 19, 2026
Merged

siyul-park merged 2 commits into
mainfrom
refactor/translate-unsupported

Conversation

@siyul-park

Copy link
Copy Markdown
Owner

Summary

transform.Translate signalled "unsupported" by returning nil, nil, nil from seven paths, and its three callers each tested f == nil — a weak contract next to coding-patterns' rule that semantic failures use ErrXxx sentinels translated at their owning boundary.

  • New transform.ErrUnsupported, wrapped with the stage that declined: no code, code before the first block, analysis, an unreached entry, or an operation build rejects.
  • compile.build maps it to compile.ErrUnsupported at its boundary (interp's policy.drain classification unchanged); SSAPass skips the function; InlinePass skips the callee.
  • TestTranslate's ten unsupported cases assert ErrorIs(err, transform.ErrUnsupported) instead of NoError + Nil.

Last of the pipeline structural cleanups (after #346–#350).

Evidence

  • Error-path-only change; generated code untouched, so no benchmark run.

Test plan

  • go test ./internal/transform ./internal/jit/... ./optimize ./interp
  • make check
  • git diff --check

🤖 Generated with Claude Code

Translate signalled "unsupported" by returning nil, nil, nil from seven
paths, and its three callers each tested f == nil. It now returns
transform.ErrUnsupported wrapped with the stage that declined: no code,
code before the first block, analysis, an unreached entry, or an
operation build rejects. compile maps it to compile.ErrUnsupported at
its boundary; SSAPass skips the function; InlinePass skips the callee.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 951ddcd9-8c45-4ab3-aa94-42b1d17978fc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@siyul-park
siyul-park merged commit d0bde3c into main Nov 19, 2026
1 check passed
@siyul-park
siyul-park deleted the refactor/translate-unsupported branch November 19, 2026 23:03
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.

1 participant