mirror of
https://github.com/swc-project/swc.git
synced 2024-12-19 11:42:13 +03:00
42 lines
638 B
TypeScript
42 lines
638 B
TypeScript
// @strict: true
|
|
|
|
declare const a: string | undefined
|
|
declare const b: string | undefined
|
|
declare const c: string | undefined
|
|
|
|
// should be a syntax error
|
|
a ?? b || c;
|
|
|
|
// should be a syntax error
|
|
a || b ?? c;
|
|
|
|
// should be a syntax error
|
|
a ?? b && c;
|
|
|
|
// should be a syntax error
|
|
a && b ?? c;
|
|
|
|
// Valid according to spec
|
|
a ?? (b || c);
|
|
|
|
// Valid according to spec
|
|
(a ?? b) || c;
|
|
|
|
// Valid according to spec
|
|
(a || b) ?? c;
|
|
|
|
// Valid according to spec
|
|
a || (b ?? c);
|
|
|
|
// Valid according to spec
|
|
a ?? (b && c);
|
|
|
|
// Valid according to spec
|
|
(a ?? b) && c;
|
|
|
|
// Valid according to spec
|
|
(a && b) ?? c;
|
|
|
|
// Valid according to spec
|
|
a && (b ?? c);
|