mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
46 lines
1.8 KiB
Plaintext
46 lines
1.8 KiB
Plaintext
index3.js(2,20): error TS2352: Conversion of type 'null' to type 'Foo' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
|
index4.js(3,20): error TS2352: Conversion of type 'null' to type 'Bar' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
|
|
|
|
|
==== index1.js (0 errors) ====
|
|
export default 12;
|
|
|
|
==== index2.js (0 errors) ====
|
|
export default function foo() {
|
|
return foo;
|
|
}
|
|
export const x = foo;
|
|
export { foo as bar };
|
|
|
|
==== index3.js (1 errors) ====
|
|
export default class Foo {
|
|
a = /** @type {Foo} */(null);
|
|
~~~
|
|
!!! error TS2352: Conversion of type 'null' to type 'Foo' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
|
};
|
|
export const X = Foo;
|
|
export { Foo as Bar };
|
|
|
|
==== index4.js (1 errors) ====
|
|
import Fab from "./index3";
|
|
class Bar extends Fab {
|
|
x = /** @type {Bar} */(null);
|
|
~~~
|
|
!!! error TS2352: Conversion of type 'null' to type 'Bar' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
|
}
|
|
export default Bar;
|
|
|
|
==== index5.js (0 errors) ====
|
|
// merge type alias and const (OK)
|
|
export default 12;
|
|
/**
|
|
* @typedef {string | number} default
|
|
*/
|
|
|
|
==== index6.js (0 errors) ====
|
|
// merge type alias and function (OK)
|
|
export default function func() {};
|
|
/**
|
|
* @typedef {string | number} default
|
|
*/
|
|
|