mirror of
https://github.com/swc-project/swc.git
synced 2024-12-28 08:04:43 +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);
|