Skip to content

Commit 6a89187

Browse files
committed
[compiler] Improve error messages for unhandled terminal and instruction kinds
1 parent a0fdb63 commit 6a89187

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,10 @@ function writeTerminal(writer: Writer, terminal: ReactiveTerminal): void {
394394
break;
395395
}
396396
default:
397-
assertExhaustive(terminal, `Unhandled terminal ${terminal}`);
397+
assertExhaustive(
398+
terminal,
399+
`Unhandled terminal kind \`${(terminal as any).kind}\``,
400+
);
398401
}
399402
}
400403

compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,10 @@ function* generateInstructionTypes(
420420
break;
421421
}
422422
default:
423-
assertExhaustive(value, `Unhandled instruction value kind: ${value}`);
423+
assertExhaustive(
424+
value,
425+
`Unhandled instruction value kind: ${(value as any).kind}`,
426+
);
424427
}
425428
}
426429

0 commit comments

Comments
 (0)