Skip to content

Commit

Permalink
[compiler] Improve error messages for unhandled terminal and instruct…
Browse files Browse the repository at this point in the history
…ion kinds
  • Loading branch information
inottn committed Feb 7, 2025
1 parent a0fdb63 commit 6a89187
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ function writeTerminal(writer: Writer, terminal: ReactiveTerminal): void {
break;
}
default:
assertExhaustive(terminal, `Unhandled terminal ${terminal}`);
assertExhaustive(
terminal,
`Unhandled terminal kind \`${(terminal as any).kind}\``,
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ function* generateInstructionTypes(
break;
}
default:
assertExhaustive(value, `Unhandled instruction value kind: ${value}`);
assertExhaustive(
value,
`Unhandled instruction value kind: ${(value as any).kind}`,
);
}
}

Expand Down

0 comments on commit 6a89187

Please # to comment.