351 lines
5.6 KiB
Plaintext
351 lines
5.6 KiB
Plaintext
exports[`test a1.js 1`] = `
|
|
"// @flow
|
|
|
|
function foo(x: number): string { return 5; }
|
|
|
|
foo(0);
|
|
|
|
module.exports = foo;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
function foo(x: number): string {
|
|
return 5;
|
|
}
|
|
|
|
foo(0);
|
|
|
|
module.exports = foo;
|
|
"
|
|
`;
|
|
|
|
exports[`test a2.js 1`] = `
|
|
"// @flow
|
|
|
|
const foo = require(\'./a1\');
|
|
|
|
module.exports = foo(\"\");
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
const foo = require(\"./a1\");
|
|
|
|
module.exports = foo(\"\");
|
|
"
|
|
`;
|
|
|
|
exports[`test a3.js 1`] = `
|
|
"// @flow
|
|
|
|
const five = require(\'./a2\');
|
|
|
|
(five + five: string);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
const five = require(\"./a2\");
|
|
|
|
(five + five: string);
|
|
"
|
|
`;
|
|
|
|
exports[`test b0.js 1`] = `
|
|
"// @flow
|
|
|
|
class C { x: C; }
|
|
class E { x: C; }
|
|
|
|
module.exports = { C, E };
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
class C {
|
|
x: C;
|
|
}
|
|
class E {
|
|
x: C;
|
|
}
|
|
|
|
module.exports = { C, E };
|
|
"
|
|
`;
|
|
|
|
exports[`test b1.js 1`] = `
|
|
"// @flow
|
|
|
|
import { C, E } from \"./b0\";
|
|
function foo() { return C; }
|
|
function bar() { return E; }
|
|
let X = foo();
|
|
class F extends X { }
|
|
class D extends F { }
|
|
module.exports = { C, D };
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { C, E } from \"./b0\";
|
|
function foo() {
|
|
return C;
|
|
}
|
|
function bar() {
|
|
return E;
|
|
}
|
|
let X = foo();
|
|
class F extends X {}
|
|
class D extends F {}
|
|
module.exports = { C, D };
|
|
"
|
|
`;
|
|
|
|
exports[`test b2.js 1`] = `
|
|
"// @flow
|
|
|
|
module.exports = require(\"./b1\");
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
module.exports = require(\"./b1\");
|
|
"
|
|
`;
|
|
|
|
exports[`test b3.js 1`] = `
|
|
"// @flow
|
|
|
|
import { C, D } from \"./b2\";
|
|
|
|
(new D: C);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { C, D } from \"./b2\";
|
|
|
|
(new D(): C);
|
|
"
|
|
`;
|
|
|
|
exports[`test c1.js 1`] = `
|
|
"// @flow
|
|
|
|
export function foo(props: { x: number }) { }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
export function foo(props: { x: number }) {
|
|
}
|
|
"
|
|
`;
|
|
|
|
exports[`test c2.js 1`] = `
|
|
"// @flow
|
|
|
|
import { foo } from \"./c1\";
|
|
|
|
export function bar(props: { x: number }) {
|
|
foo({ x: 0 });
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { foo } from \"./c1\";
|
|
|
|
export function bar(props: { x: number }) {
|
|
foo({ x: 0 });
|
|
}
|
|
"
|
|
`;
|
|
|
|
exports[`test c3.js 1`] = `
|
|
"// @flow
|
|
|
|
import { bar } from \"./c2\";
|
|
|
|
bar({ x: 0 });
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { bar } from \"./c2\";
|
|
|
|
bar({ x: 0 });
|
|
"
|
|
`;
|
|
|
|
exports[`test d1.js 1`] = `
|
|
"// @flow
|
|
|
|
export class A {}
|
|
export class B {}
|
|
export var x = new A;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
export class A {}
|
|
export class B {}
|
|
export var x = new A();
|
|
"
|
|
`;
|
|
|
|
exports[`test d2.js 1`] = `
|
|
"// @flow
|
|
|
|
import {A, x} from \"./d1\";
|
|
export var y: A = x;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { A, x } from \"./d1\";
|
|
export var y: A = x;
|
|
"
|
|
`;
|
|
|
|
exports[`test e1.js 1`] = `
|
|
"// @flow
|
|
|
|
export type Action =
|
|
| { type: \'FOO\' }
|
|
| { type: \'BAR\' }
|
|
;
|
|
|
|
export const LIFE = 42;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
export type Action = { type: \"FOO\" } | { type: \"BAR\" };
|
|
|
|
export const LIFE = 42;
|
|
"
|
|
`;
|
|
|
|
exports[`test e2.js 1`] = `
|
|
"// @flow
|
|
|
|
import type { Action } from \'./e1\';
|
|
|
|
const f = (): Action => {
|
|
return { type: \'FOO\' };
|
|
}
|
|
|
|
import { LIFE } from \'./e1\';
|
|
|
|
(LIFE: 42);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import type { Action } from \"./e1\";
|
|
|
|
const f = (): Action => {
|
|
return { type: \"FOO\" };
|
|
};
|
|
|
|
import { LIFE } from \"./e1\";
|
|
|
|
(LIFE: 42);
|
|
"
|
|
`;
|
|
|
|
exports[`test f1.js 1`] = `
|
|
"// @flow
|
|
|
|
type T = { x: number };
|
|
type S = { x: string };
|
|
|
|
declare var a: T;
|
|
declare var b: S;
|
|
declare var c: T;
|
|
|
|
module.exports = { a, b, c };
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
type T = { x: number };
|
|
type S = { x: string };
|
|
|
|
declare var a: T;
|
|
declare var b: S;
|
|
declare var c: T;
|
|
|
|
module.exports = { a, b, c };
|
|
"
|
|
`;
|
|
|
|
exports[`test f2.js 1`] = `
|
|
"// @flow
|
|
|
|
var { a, b, c } = require(\'./f1\');
|
|
(c: { x: number });
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
var { a, b, c } = require(\"./f1\");
|
|
(c: { x: number });
|
|
"
|
|
`;
|
|
|
|
exports[`test g1.js 1`] = `
|
|
"// @flow
|
|
|
|
export class C { }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
export class C {}
|
|
"
|
|
`;
|
|
|
|
exports[`test g2.js 1`] = `
|
|
"// @flow
|
|
|
|
import { C } from \'./g1\';
|
|
|
|
class D extends C { }
|
|
|
|
module.exports = { D };
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { C } from \"./g1\";
|
|
|
|
class D extends C {}
|
|
|
|
module.exports = { D };
|
|
"
|
|
`;
|
|
|
|
exports[`test g3.js 1`] = `
|
|
"// @flow
|
|
|
|
import { C } from \'./g1\';
|
|
import { D } from \'./g2\';
|
|
|
|
(new D: C)
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import { C } from \"./g1\";
|
|
import { D } from \"./g2\";
|
|
|
|
(new D(): C);
|
|
"
|
|
`;
|
|
|
|
exports[`test h1.js 1`] = `
|
|
"// @flow
|
|
|
|
export type Foo = number;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
export type Foo = number;
|
|
"
|
|
`;
|
|
|
|
exports[`test h2.js 1`] = `
|
|
"// @flow
|
|
|
|
import type { Foo } from \'./h1\';
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// @flow
|
|
|
|
import type { Foo } from \"./h1\";
|
|
"
|
|
`;
|