-
-
Notifications
You must be signed in to change notification settings - Fork 673
Closed
Labels
Description
let a = 1;
function foo(): string | null {
return a > 10 ? null : "";
}
export class B {
test(): void {
let t: string | null = foo();
if (t != null) {
let v: string = t; // ERROR TS2322: Type '~lib/string/String | null' is not assignable to type '~lib/string/String'.
}
}
}
export function test(): void {
let t: string | null = foo();
if (t != null) {
let v: string = t; // ERROR TS2322: Type '~lib/string/String | null' is not assignable to type '~lib/string/String'.
}
}