@@ -61,10 +61,25 @@ class X {
6161 const p = new . target ?? 32 ;
6262 }
6363}
64+
65+ // https://github.com/microsoft/TypeScript/issues/60614
66+ declare function tag < T > (
67+ strings: TemplateStringsArray,
68+ ...values: number[]
69+ ): T | null;
70+
71+ tag`foo${ 1 } ` ?? 32; // ok
72+
73+ `foo${ 1 } ` ?? 32; // error
74+ `foo` ?? 32; // error
6475
6576
6677//// [predicateSemantics.js]
67- var _a , _b , _c , _d , _e , _f , _g , _h , _j ;
78+ var __makeTemplateObject = (this && this . __makeTemplateObject ) || function ( cooked , raw ) {
79+ if ( Object . defineProperty ) { Object . defineProperty ( cooked , "raw" , { value : raw } ) ; } else { cooked . raw = raw ; }
80+ return cooked;
81+ } ;
82+ var _a , _b , _c , _d , _e , _f , _g , _h , _j , _k , _l ;
6883// OK: One or other operand is possibly nullish
6984var test1 = ( _a = ( cond ? undefined : 32 ) ) !== null && _a !== void 0 ? _a : "possibly reached" ;
7085// Not OK: Both operands nullish
@@ -122,3 +137,6 @@ var X = /** @class */ (function () {
122137 }
123138 return X ;
124139} ( ) ) ;
140+ ( _k = tag ( __makeTemplateObject ( [ "foo" , "" ] , [ "foo" , "" ] ) , 1 ) ) !== null && _k !== void 0 ? _k : 32 ; // ok
141+ ( _l = "foo" . concat ( 1 ) ) !== null && _l !== void 0 ? _l : 32 ; // error
142+ "foo" !== null && "foo" !== void 0 ? "foo" : 32 ; // error
0 commit comments