2016-12-23 22:31:38 +03:00
|
|
|
exports[`test a1.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
|
|
|
function foo(x: number): string { return 5; }
|
|
|
|
|
|
|
|
foo(0);
|
|
|
|
|
|
|
|
module.exports = foo;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
|
|
|
function foo(x: number): string {
|
2016-12-27 21:29:31 +03:00
|
|
|
return [object Number];
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-27 21:29:31 +03:00
|
|
|
foo([object Number]);
|
2016-12-23 22:31:38 +03:00
|
|
|
module.exports = foo;
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test a2.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
const foo = require('./a1');
|
2016-12-23 22:31:38 +03:00
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
module.exports = foo("");
|
2016-12-23 22:31:38 +03:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
const foo = require("./a1");
|
|
|
|
module.exports = foo("");
|
2016-12-23 22:31:38 +03:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test a3.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
const five = require('./a2');
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
(five + five: string);
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
const five = require("./a2");
|
2016-12-23 22:31:38 +03:00
|
|
|
(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
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C, E } from "./b0";
|
2016-12-23 22:31:38 +03:00
|
|
|
function foo() { return C; }
|
|
|
|
function bar() { return E; }
|
|
|
|
let X = foo();
|
|
|
|
class F extends X { }
|
|
|
|
class D extends F { }
|
|
|
|
module.exports = { C, D };
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C, E } from "./b0";
|
2016-12-23 22:31:38 +03:00
|
|
|
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
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
module.exports = require("./b1");
|
2016-12-23 22:31:38 +03:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
module.exports = require("./b1");
|
2016-12-23 22:31:38 +03:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test b3.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C, D } from "./b2";
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
(new D: C);
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C, D } from "./b2";
|
2016-12-23 22:31:38 +03:00
|
|
|
(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
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { foo } from "./c1";
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
export function bar(props: { x: number }) {
|
|
|
|
foo({ x: 0 });
|
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { foo } from "./c1";
|
2016-12-23 22:31:38 +03:00
|
|
|
export function bar(props: { x: number }) {
|
2016-12-27 21:29:31 +03:00
|
|
|
foo({ x: [object Number] });
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test c3.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { bar } from "./c2";
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
bar({ x: 0 });
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { bar } from "./c2";
|
|
|
|
bar({ x: [object Number] });
|
2016-12-23 22:31:38 +03:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import {A, x} from "./d1";
|
2016-12-23 22:31:38 +03:00
|
|
|
export var y: A = x;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { A, x } from "./d1";
|
2016-12-23 22:31:38 +03:00
|
|
|
export var y: A = x;
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test e1.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
|
|
|
export type Action =
|
2016-12-27 21:29:31 +03:00
|
|
|
| { type: 'FOO' }
|
|
|
|
| { type: 'BAR' }
|
2016-12-23 22:31:38 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
export const LIFE = 42;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2016-12-27 21:29:31 +03:00
|
|
|
// @flow
|
|
|
|
export type Action = { type: "FOO" } | { type: "BAR" };
|
|
|
|
export const LIFE = [object Number];
|
2016-12-23 22:31:38 +03:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test e2.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import type { Action } from './e1';
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
const f = (): Action => {
|
2016-12-27 21:29:31 +03:00
|
|
|
return { type: 'FOO' };
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { LIFE } from './e1';
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
(LIFE: 42);
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2016-12-27 21:29:31 +03:00
|
|
|
// @flow
|
|
|
|
import type { Action } from "./e1";
|
|
|
|
const f = (): Action => {
|
|
|
|
return { type: "FOO" };
|
|
|
|
};
|
|
|
|
import { LIFE } from "./e1";
|
|
|
|
(LIFE: 42);
|
2016-12-23 22:31:38 +03:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
var { a, b, c } = require('./f1');
|
2016-12-23 22:31:38 +03:00
|
|
|
(c: { x: number });
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
var { a, b, c } = require("./f1");
|
2016-12-23 22:31:38 +03:00
|
|
|
(c: { x: number });
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test g1.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
|
|
|
export class C { }
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
|
|
|
export class C {}
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test g2.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C } from './g1';
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
class D extends C { }
|
|
|
|
|
|
|
|
module.exports = { D };
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C } from "./g1";
|
2016-12-23 22:31:38 +03:00
|
|
|
class D extends C {}
|
|
|
|
module.exports = { D };
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test g3.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C } from './g1';
|
|
|
|
import { D } from './g2';
|
2016-12-23 22:31:38 +03:00
|
|
|
|
|
|
|
(new D: C)
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import { C } from "./g1";
|
|
|
|
import { D } from "./g2";
|
2016-12-23 22:31:38 +03:00
|
|
|
(new D(): C);
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test h1.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
|
|
|
export type Foo = number;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
|
|
|
export type Foo = number;
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test h2.js 1`] = `
|
|
|
|
"// @flow
|
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
import type { Foo } from './h1';
|
2016-12-23 22:31:38 +03:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// @flow
|
2016-12-27 21:29:31 +03:00
|
|
|
import type { Foo } from "./h1";
|
2016-12-23 22:31:38 +03:00
|
|
|
"
|
|
|
|
`;
|