// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`B.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

exports.numberValue = 42;

=====================================output=====================================
/* @flow */

exports.numberValue = 42;

================================================================================
`;

exports[`C.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

=====================================output=====================================
/* @flow */

================================================================================
`;

exports[`CommonJS_Clobbering_Class.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule CommonJS_Clobbering_Class
 * @flow
 */

class Base {
  static baseProp: number;
}

class Test extends Base {
  static childProp: number;

  static staticNumber1():number { return 1; }
  static staticNumber2():number { return 2; }
  static staticNumber3():number { return 3; }

  instNumber1():number { return 1; }
  instNumber2():number { return 2; }
};

module.exports = Test;

=====================================output=====================================
/**
 * @providesModule CommonJS_Clobbering_Class
 * @flow
 */

class Base {
  static baseProp: number;
}

class Test extends Base {
  static childProp: number;

  static staticNumber1(): number {
    return 1;
  }
  static staticNumber2(): number {
    return 2;
  }
  static staticNumber3(): number {
    return 3;
  }

  instNumber1(): number {
    return 1;
  }
  instNumber2(): number {
    return 2;
  }
}

module.exports = Test;

================================================================================
`;

exports[`CommonJS_Clobbering_Frozen.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule CommonJS_Clobbering_Frozen
 * @flow
 */

module.exports = Object.freeze({
  numberValue1: 1,
});

=====================================output=====================================
/**
 * @providesModule CommonJS_Clobbering_Frozen
 * @flow
 */

module.exports = Object.freeze({
  numberValue1: 1
});

================================================================================
`;

exports[`CommonJS_Clobbering_Lit.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule CommonJS_Clobbering_Lit
 * @flow
 */

module.exports = {
  numberValue1: 1,
  numberValue2: 2,
  numberValue3: 3,
  numberValue4: 4,
  numberValue5: 5
};

=====================================output=====================================
/**
 * @providesModule CommonJS_Clobbering_Lit
 * @flow
 */

module.exports = {
  numberValue1: 1,
  numberValue2: 2,
  numberValue3: 3,
  numberValue4: 4,
  numberValue5: 5
};

================================================================================
`;

exports[`CommonJS_Named.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule CommonJS_Named
 * @flow
 */

exports.numberValue1 = 1;
exports.numberValue2 = 2;
exports.numberValue3 = 3;
exports.numberValue4 = 4;
exports.numberValue5 = 5;

=====================================output=====================================
/**
 * @providesModule CommonJS_Named
 * @flow
 */

exports.numberValue1 = 1;
exports.numberValue2 = 2;
exports.numberValue3 = 3;
exports.numberValue4 = 4;
exports.numberValue5 = 5;

================================================================================
`;

exports[`ES6_Default_AnonClass1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_AnonClass1
 * @flow
 */

export default class { givesANum(): number { return 42; }};

=====================================output=====================================
/**
 * @providesModule ES6_Default_AnonClass1
 * @flow
 */

export default class {
  givesANum(): number {
    return 42;
  }
}

================================================================================
`;

exports[`ES6_Default_AnonClass2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_AnonClass2
 * @flow
 */

export default class { givesANum(): number { return 42; }};

=====================================output=====================================
/**
 * @providesModule ES6_Default_AnonClass2
 * @flow
 */

export default class {
  givesANum(): number {
    return 42;
  }
}

================================================================================
`;

exports[`ES6_Default_AnonFunction1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_AnonFunction1
 * @flow
 */

export default function():number { return 42; }

=====================================output=====================================
/**
 * @providesModule ES6_Default_AnonFunction1
 * @flow
 */

export default function(): number {
  return 42;
}

================================================================================
`;

exports[`ES6_Default_AnonFunction2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_AnonFunction2
 * @flow
 */

export default function():number { return 42; }

=====================================output=====================================
/**
 * @providesModule ES6_Default_AnonFunction2
 * @flow
 */

export default function(): number {
  return 42;
}

================================================================================
`;

exports[`ES6_Default_NamedClass1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_NamedClass1
 * @flow
 */

export default class Foo { givesANum(): number { return 42; }};

// Regression test for https://github.com/facebook/flow/issues/511
//
// Default-exported class should also be available in local scope
new Foo();

=====================================output=====================================
/**
 * @providesModule ES6_Default_NamedClass1
 * @flow
 */

export default class Foo {
  givesANum(): number {
    return 42;
  }
}

// Regression test for https://github.com/facebook/flow/issues/511
//
// Default-exported class should also be available in local scope
new Foo();

================================================================================
`;

exports[`ES6_Default_NamedClass2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_NamedClass2
 * @flow
 */

export default class Foo { givesANum(): number { return 42; }};

=====================================output=====================================
/**
 * @providesModule ES6_Default_NamedClass2
 * @flow
 */

export default class Foo {
  givesANum(): number {
    return 42;
  }
}

================================================================================
`;

exports[`ES6_Default_NamedFunction1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_NamedFunction1
 * @flow
 */

export default function foo():number { return 42; }

=====================================output=====================================
/**
 * @providesModule ES6_Default_NamedFunction1
 * @flow
 */

export default function foo(): number {
  return 42;
}

================================================================================
`;

exports[`ES6_Default_NamedFunction2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Default_NamedFunction2
 * @flow
 */

export default function foo():number { return 42; }

=====================================output=====================================
/**
 * @providesModule ES6_Default_NamedFunction2
 * @flow
 */

export default function foo(): number {
  return 42;
}

================================================================================
`;

exports[`ES6_DefaultAndNamed.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

export default 42;
export var str = 'asdf';

=====================================output=====================================
/* @flow */

export default 42;
export var str = "asdf";

================================================================================
`;

exports[`ES6_ExportAllFrom_Intermediary1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportAllFrom_Intermediary1
 * @flow
 */

export * from "ES6_ExportAllFrom_Source1";

=====================================output=====================================
/**
 * @providesModule ES6_ExportAllFrom_Intermediary1
 * @flow
 */

export * from "ES6_ExportAllFrom_Source1";

================================================================================
`;

exports[`ES6_ExportAllFrom_Intermediary2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportAllFrom_Intermediary2
 * @flow
 */

export * from "ES6_ExportAllFrom_Source2";

=====================================output=====================================
/**
 * @providesModule ES6_ExportAllFrom_Intermediary2
 * @flow
 */

export * from "ES6_ExportAllFrom_Source2";

================================================================================
`;

exports[`ES6_ExportAllFrom_Source1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportAllFrom_Source1
 * @flow
 */

export var numberValue1 = 1;

=====================================output=====================================
/**
 * @providesModule ES6_ExportAllFrom_Source1
 * @flow
 */

export var numberValue1 = 1;

================================================================================
`;

exports[`ES6_ExportAllFrom_Source2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportAllFrom_Source2
 * @flow
 */

export var numberValue2 = 1;

=====================================output=====================================
/**
 * @providesModule ES6_ExportAllFrom_Source2
 * @flow
 */

export var numberValue2 = 1;

================================================================================
`;

exports[`ES6_ExportAllFromMulti.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// @flow

export * from "./ES6_ExportAllFrom_Source1";
export * from "./ES6_ExportAllFrom_Source2";

=====================================output=====================================
// @flow

export * from "./ES6_ExportAllFrom_Source1";
export * from "./ES6_ExportAllFrom_Source2";

================================================================================
`;

exports[`ES6_ExportFrom_Intermediary1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportFrom_Intermediary1
 * @flow
 */

export {
  numberValue1,
  numberValue2 as numberValue2_renamed
} from "ES6_ExportFrom_Source1";

=====================================output=====================================
/**
 * @providesModule ES6_ExportFrom_Intermediary1
 * @flow
 */

export {
  numberValue1,
  numberValue2 as numberValue2_renamed
} from "ES6_ExportFrom_Source1";

================================================================================
`;

exports[`ES6_ExportFrom_Intermediary2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportFrom_Intermediary2
 * @flow
 */

export {
  numberValue1,
  numberValue2 as numberValue2_renamed2
} from "ES6_ExportFrom_Source2";

=====================================output=====================================
/**
 * @providesModule ES6_ExportFrom_Intermediary2
 * @flow
 */

export {
  numberValue1,
  numberValue2 as numberValue2_renamed2
} from "ES6_ExportFrom_Source2";

================================================================================
`;

exports[`ES6_ExportFrom_Source1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportFrom_Source1
 * @flow
 */

export var numberValue1 = 1, numberValue2 = 2;

=====================================output=====================================
/**
 * @providesModule ES6_ExportFrom_Source1
 * @flow
 */

export var numberValue1 = 1,
  numberValue2 = 2;

================================================================================
`;

exports[`ES6_ExportFrom_Source2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_ExportFrom_Source2
 * @flow
 */

export var numberValue1 = 1, numberValue2 = 2;

=====================================output=====================================
/**
 * @providesModule ES6_ExportFrom_Source2
 * @flow
 */

export var numberValue1 = 1,
  numberValue2 = 2;

================================================================================
`;

exports[`ES6_Named1.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Named1
 * @flow
 */

var specifierNumber1 = 1;
var specifierNumber2 = 2;
var specifierNumber3 = 3;
var groupedSpecifierNumber1 = 1;
var groupedSpecifierNumber2 = 2;

export {specifierNumber1};
export {specifierNumber2 as specifierNumber2Renamed};
export {specifierNumber3};
export {groupedSpecifierNumber1, groupedSpecifierNumber2};

export function givesANumber(): number { return 42; };
export class NumberGenerator { givesANumber(): number { return 42; }};

export var varDeclNumber1 = 1, varDeclNumber2 = 2;
export var {destructuredObjNumber} = {destructuredObjNumber: 1};
export var [destructuredArrNumber] = [1]

=====================================output=====================================
/**
 * @providesModule ES6_Named1
 * @flow
 */

var specifierNumber1 = 1;
var specifierNumber2 = 2;
var specifierNumber3 = 3;
var groupedSpecifierNumber1 = 1;
var groupedSpecifierNumber2 = 2;

export { specifierNumber1 };
export { specifierNumber2 as specifierNumber2Renamed };
export { specifierNumber3 };
export { groupedSpecifierNumber1, groupedSpecifierNumber2 };

export function givesANumber(): number {
  return 42;
}
export class NumberGenerator {
  givesANumber(): number {
    return 42;
  }
}

export var varDeclNumber1 = 1,
  varDeclNumber2 = 2;
export var { destructuredObjNumber } = { destructuredObjNumber: 1 };
export var [destructuredArrNumber] = [1];

================================================================================
`;

exports[`ES6_Named2.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6_Named2
 * @flow
 */

var specifierNumber4 = 1;
var specifierNumber5 = 2;
var groupedSpecifierNumber3 = 1;
var groupedSpecifierNumber4 = 2;

export {specifierNumber4};
export {specifierNumber5 as specifierNumber5Renamed};
export {groupedSpecifierNumber3, groupedSpecifierNumber4};

export function givesANumber2(): number { return 42; };
export class NumberGenerator2 { givesANumber(): number { return 42; }};

export var varDeclNumber3 = 1, varDeclNumber4 = 2;
export var {destructuredObjNumber2} = {destructuredObjNumber2: 1};
export var [destructuredArrNumber2] = [1]

=====================================output=====================================
/**
 * @providesModule ES6_Named2
 * @flow
 */

var specifierNumber4 = 1;
var specifierNumber5 = 2;
var groupedSpecifierNumber3 = 1;
var groupedSpecifierNumber4 = 2;

export { specifierNumber4 };
export { specifierNumber5 as specifierNumber5Renamed };
export { groupedSpecifierNumber3, groupedSpecifierNumber4 };

export function givesANumber2(): number {
  return 42;
}
export class NumberGenerator2 {
  givesANumber(): number {
    return 42;
  }
}

export var varDeclNumber3 = 1,
  varDeclNumber4 = 2;
export var { destructuredObjNumber2 } = { destructuredObjNumber2: 1 };
export var [destructuredArrNumber2] = [1];

================================================================================
`;

exports[`ExportType.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// @flow

export type typeAlias = number;

=====================================output=====================================
// @flow

export type typeAlias = number;

================================================================================
`;

exports[`ProvidesModuleA.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule A
 * @flow
 */

exports.numberValue1 = 42;
exports.numberValue2 = 42;
exports.numberValue3 = 42;
exports.numberValue4 = 42;
exports.stringValue = "str";

=====================================output=====================================
/**
 * @providesModule A
 * @flow
 */

exports.numberValue1 = 42;
exports.numberValue2 = 42;
exports.numberValue3 = 42;
exports.numberValue4 = 42;
exports.stringValue = "str";

================================================================================
`;

exports[`ProvidesModuleCJSDefault.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule CJSDefault
 * @flow
 */

module.exports = {
  numberValue: 42
};

=====================================output=====================================
/**
 * @providesModule CJSDefault
 * @flow
 */

module.exports = {
  numberValue: 42
};

================================================================================
`;

exports[`ProvidesModuleD.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule D
 * @flow
 */

=====================================output=====================================
/**
 * @providesModule D
 * @flow
 */

================================================================================
`;

exports[`ProvidesModuleES6Default.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/**
 * @providesModule ES6Default
 * @flow
 */

/*
export default {
  numberValue: 42,
};
*/

=====================================output=====================================
/**
 * @providesModule ES6Default
 * @flow
 */

/*
export default {
  numberValue: 42,
};
*/

================================================================================
`;

exports[`SideEffects.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

=====================================output=====================================
/* @flow */

================================================================================
`;

exports[`es6modules.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

// ===================== //
// == Path Resolution == //
// ===================== //

// @providesModule
import * as DefaultA from "A";
var a1: number = DefaultA.numberValue1;
var a2: string = DefaultA.numberValue1; // Error: number ~> string

// File path
import * as DefaultB from "./B";
var b1: number = DefaultB.numberValue;
var b2: string = DefaultB.numberValue; // Error: number ~> string

// C.js exists, but not as a providesModule
import DefaultC from "C"; // Error: No such module

// @providesModule D exists, but not as a filename
import DefaultD from "./D"; // Error: No such module

// ================================================ //
// == CommonJS Clobbering Literal Exports -> ES6 == //
// ================================================ //

import {doesntExist1} from "CommonJS_Clobbering_Lit"; // Error: Not an exported binding

import {numberValue1} from "CommonJS_Clobbering_Lit";
var c1: number = numberValue1;
var c2: string = numberValue1; // Error: number ~> string

import {numberValue2 as numVal1} from "CommonJS_Clobbering_Lit";
var d1: number = numVal1;
var d2: string = numVal1; // Error: number ~> string

import CJS_Clobb_Lit from "CommonJS_Clobbering_Lit";
var e1: number = CJS_Clobb_Lit.numberValue3;
var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string
CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property

import * as CJS_Clobb_Lit_NS from "CommonJS_Clobbering_Lit";
var f1: number = CJS_Clobb_Lit_NS.numberValue4;
var f2: number = CJS_Clobb_Lit_NS.default.numberValue4;
CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj
var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string
var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string

// ============================================== //
// == CommonJS Clobbering Class Exports -> ES6 == //
// ============================================== //

import {doesntExist2} from "CommonJS_Clobbering_Class"; // Error: Not an exported binding

// The following import should error because class statics are not turned into
// named exports for now. This avoids complexities with polymorphic static
// members (where the polymophism is defined on the class itself rather than the
// method).
import {staticNumber1, baseProp, childProp} from "CommonJS_Clobbering_Class"; // Error

import CJS_Clobb_Class from "CommonJS_Clobbering_Class";
new CJS_Clobb_Class();
new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property
var h1: number = CJS_Clobb_Class.staticNumber2();
var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string
var h3: number = new CJS_Clobb_Class().instNumber1();
var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string

import * as CJS_Clobb_Class_NS from "CommonJS_Clobbering_Class";
new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable
var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object
var i2: number = new CJS_Clobb_Class_NS.default().instNumber2();
var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string

// =================================== //
// == CommonJS Named Exports -> ES6 == //
// =================================== //

import {doesntExist3} from "CommonJS_Named"; // Error: Not an exported binding

import {numberValue2} from "CommonJS_Named";
var j1: number = numberValue2;
var j2: string = numberValue2; // Error: number ~> string

import {numberValue3 as numVal3} from "CommonJS_Named";
var k1: number = numVal3;
var k2: string = numVal3; // Error: number ~> string

import * as CJS_Named from "CommonJS_Named";
var l1: number = CJS_Named.numberValue1;
var l2: string = CJS_Named.numberValue1; // Error: number ~> string
CJS_Named.doesntExist; // Error: doesntExist isn't a property

import * as CJS_Named_NS from "CommonJS_Named";
var m1: number = CJS_Named_NS.numberValue4;
var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export
var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string

//////////////////////////////
// == ES6 Default -> ES6 == //
//////////////////////////////

import {doesntExist4} from "ES6_Default_AnonFunction1"; // Error: Not an exported binding

import ES6_Def_AnonFunc1 from "ES6_Default_AnonFunction1";
var n1: number = ES6_Def_AnonFunc1();
var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string

import ES6_Def_NamedFunc1 from "ES6_Default_NamedFunction1";
var o1: number = ES6_Def_NamedFunc1();
var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string

import ES6_Def_AnonClass1 from "ES6_Default_AnonClass1";
var p1: number = new ES6_Def_AnonClass1().givesANum();
var p2: string = new ES6_Def_AnonClass1().givesANum(); // Error: number ~> string

import ES6_Def_NamedClass1 from "ES6_Default_NamedClass1";
var q1: number = new ES6_Def_NamedClass1().givesANum();
var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string

////////////////////////////
// == ES6 Named -> ES6 == //
////////////////////////////

import doesntExist5 from "ES6_Named1"; // Error: Not an exported binding

import {specifierNumber1 as specifierNumber1_1} from "ES6_Named1";
var r1: number = specifierNumber1_1;
var r2: string = specifierNumber1_1; // Error: number ~> string

import {specifierNumber2Renamed} from "ES6_Named1";
var s1: number = specifierNumber2Renamed;
var s2: string = specifierNumber2Renamed; // Error: number ~> string

import {specifierNumber3 as specifierNumber3Renamed} from "ES6_Named1";
var t1: number = specifierNumber3Renamed;
var t2: string = specifierNumber3Renamed; // Error: number ~> string

import {groupedSpecifierNumber1, groupedSpecifierNumber2} from "ES6_Named1";
var u1: number = groupedSpecifierNumber1;
var u2: number = groupedSpecifierNumber2;
var u3: string = groupedSpecifierNumber1; // Error: number ~> string
var u4: string = groupedSpecifierNumber2; // Error: number ~> string

import {givesANumber} from "ES6_Named1";
var v1: number = givesANumber();
var v2: string = givesANumber(); // Error: number ~> string

import {NumberGenerator} from "ES6_Named1";
var w1: number = new NumberGenerator().givesANumber();
var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string

import {varDeclNumber1, varDeclNumber2} from "ES6_Named1";
var x1: number = varDeclNumber1;
var x2: number = varDeclNumber2;
var x3: string = varDeclNumber1; // Error: number ~> string
var x4: string = varDeclNumber2; // Error: number ~> string

import {destructuredObjNumber} from "ES6_Named1";
var y1: number = destructuredObjNumber;
var y2: string = destructuredObjNumber; // Error: number ~> string

import {destructuredArrNumber} from "ES6_Named1";
var z1: number = destructuredArrNumber;
var z2: string = destructuredArrNumber; // Error: number ~> string

import {numberValue1 as numberValue4} from "ES6_ExportFrom_Intermediary1";
var aa1: number = numberValue4;
var aa2: string = numberValue4; // Error: number ~> string

import {numberValue2_renamed} from "ES6_ExportFrom_Intermediary1";
var ab1: number = numberValue2_renamed;
var ab2: string = numberValue2_renamed; // Error: number ~> string

import {numberValue1 as numberValue5} from "ES6_ExportAllFrom_Intermediary1";
var ac1: number = numberValue5;
var ac2: string = numberValue5; // Error: number ~> string

///////////////////////////////////
// == ES6 Default -> CommonJS == //
///////////////////////////////////

require('ES6_Default_AnonFunction2').doesntExist; // Error: 'doesntExist' isn't an export

var ES6_Def_AnonFunc2 = require("ES6_Default_AnonFunction2").default;
var ad1: number = ES6_Def_AnonFunc2();
var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string

var ES6_Def_NamedFunc2 = require("ES6_Default_NamedFunction2").default;
var ae1: number = ES6_Def_NamedFunc2();
var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string

var ES6_Def_AnonClass2 = require("ES6_Default_AnonClass2").default;
var af1: number = new ES6_Def_AnonClass2().givesANum();
var af2: string = new ES6_Def_AnonClass2().givesANum(); // Error: number ~> string

var ES6_Def_NamedClass2 = require("ES6_Default_NamedClass2").default;
var ag1: number = new ES6_Def_NamedClass2().givesANum();
var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string

/////////////////////////////////
// == ES6 Named -> CommonJS == //
/////////////////////////////////

var specifierNumber4 = require("ES6_Named2").specifierNumber4;
var ah1: number = specifierNumber4;
var ah2: string = specifierNumber4; // Error: number ~> string

var specifierNumber5Renamed = require("ES6_Named2").specifierNumber5Renamed;
var ai1: number = specifierNumber5Renamed;
var ai2: string = specifierNumber5Renamed; // Error: number ~> string

var groupedSpecifierNumber3 = require("ES6_Named2").groupedSpecifierNumber3;
var groupedSpecifierNumber4 = require("ES6_Named2").groupedSpecifierNumber4;
var aj1: number = groupedSpecifierNumber3;
var aj2: number = groupedSpecifierNumber4;
var aj3: string = groupedSpecifierNumber3; // Error: number ~> string
var aj4: string = groupedSpecifierNumber4; // Error: number ~> string

var givesANumber2 = require("ES6_Named2").givesANumber2;
var ak1: number = givesANumber2();
var ak2: string = givesANumber2(); // Error: number ~> string

var NumberGenerator2 = require("ES6_Named2").NumberGenerator2;
var al1: number = new NumberGenerator2().givesANumber();
var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string

var varDeclNumber3 = require("ES6_Named2").varDeclNumber3;
var varDeclNumber4 = require("ES6_Named2").varDeclNumber4;
var am1: number = varDeclNumber3;
var am2: number = varDeclNumber4;
var am3: string = varDeclNumber3; // Error: number ~> string
var am4: string = varDeclNumber4; // Error: number ~> string

var destructuredObjNumber2 = require("ES6_Named2").destructuredObjNumber2;
var an1: number = destructuredObjNumber2;
var an2: string = destructuredObjNumber2; // Error: number ~> string

var destructuredArrNumber2 = require("ES6_Named2").destructuredArrNumber2;
var ao1: number = destructuredArrNumber2;
var ao2: string = destructuredArrNumber2; // Error: number ~> string

var numberValue6 = require("ES6_ExportFrom_Intermediary2").numberValue1;
var ap1: number = numberValue6;
var ap2: string = numberValue6; // Error: number ~> string

var numberValue2_renamed2 = require("ES6_ExportFrom_Intermediary2").numberValue2_renamed2;
var aq1: number = numberValue2_renamed2;
var aq2: string = numberValue2_renamed2; // Error: number ~> string

var numberValue7 = require("ES6_ExportAllFrom_Intermediary2").numberValue2;
var ar1: number = numberValue7;
var ar2: string = numberValue7; // Error: number ~> string

////////////////////////////////////////////////////////
// == ES6 Default+Named -> ES6 import Default+Named== //
////////////////////////////////////////////////////////

import defaultNum, {str as namedStr} from "./ES6_DefaultAndNamed";

var as1: number = defaultNum;
var as2: string = defaultNum; // Error: number ~> string

var as3: string = namedStr;
var as4: number = namedStr; // Error: string ~> number

////////////////////////////////////////
// == Side-effect only ES6 imports == //
////////////////////////////////////////

import "./SideEffects";

//////////////////////////////////////////////
// == Suggest export name on likely typo == //
//////////////////////////////////////////////
import specifierNumber1 from "ES6_Named1"; // Error: Did you mean \`import {specifierNumber1} from ...\`?
import {specifierNumber} from "ES6_Named1"; // Error: Did you mean \`specifierNumber1\`?

///////////////////////////////////////////////////
// == Multi \`export *\` should combine exports == //
///////////////////////////////////////////////////
import {
  numberValue1 as numberValue8,
  numberValue2 as numberValue9
} from "./ES6_ExportAllFromMulti";

var at1: number = numberValue8;
var at2: string = numberValue8; // Error: number ~> string

var at3: number = numberValue9;
var at4: string = numberValue9; // Error: number ~> string

/////////////////////////////////////////////////////////////
// == Vanilla \`import\` cannot import a type-only export == //
/////////////////////////////////////////////////////////////
import {typeAlias} from "./ExportType"; // Error: Cannot vanilla-import a type alias!

=====================================output=====================================
/* @flow */

// ===================== //
// == Path Resolution == //
// ===================== //

// @providesModule
import * as DefaultA from "A";
var a1: number = DefaultA.numberValue1;
var a2: string = DefaultA.numberValue1; // Error: number ~> string

// File path
import * as DefaultB from "./B";
var b1: number = DefaultB.numberValue;
var b2: string = DefaultB.numberValue; // Error: number ~> string

// C.js exists, but not as a providesModule
import DefaultC from "C"; // Error: No such module

// @providesModule D exists, but not as a filename
import DefaultD from "./D"; // Error: No such module

// ================================================ //
// == CommonJS Clobbering Literal Exports -> ES6 == //
// ================================================ //

import { doesntExist1 } from "CommonJS_Clobbering_Lit"; // Error: Not an exported binding

import { numberValue1 } from "CommonJS_Clobbering_Lit";
var c1: number = numberValue1;
var c2: string = numberValue1; // Error: number ~> string

import { numberValue2 as numVal1 } from "CommonJS_Clobbering_Lit";
var d1: number = numVal1;
var d2: string = numVal1; // Error: number ~> string

import CJS_Clobb_Lit from "CommonJS_Clobbering_Lit";
var e1: number = CJS_Clobb_Lit.numberValue3;
var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string
CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property

import * as CJS_Clobb_Lit_NS from "CommonJS_Clobbering_Lit";
var f1: number = CJS_Clobb_Lit_NS.numberValue4;
var f2: number = CJS_Clobb_Lit_NS.default.numberValue4;
CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj
var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string
var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string

// ============================================== //
// == CommonJS Clobbering Class Exports -> ES6 == //
// ============================================== //

import { doesntExist2 } from "CommonJS_Clobbering_Class"; // Error: Not an exported binding

// The following import should error because class statics are not turned into
// named exports for now. This avoids complexities with polymorphic static
// members (where the polymophism is defined on the class itself rather than the
// method).
import { staticNumber1, baseProp, childProp } from "CommonJS_Clobbering_Class"; // Error

import CJS_Clobb_Class from "CommonJS_Clobbering_Class";
new CJS_Clobb_Class();
new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property
var h1: number = CJS_Clobb_Class.staticNumber2();
var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string
var h3: number = new CJS_Clobb_Class().instNumber1();
var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string

import * as CJS_Clobb_Class_NS from "CommonJS_Clobbering_Class";
new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable
var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object
var i2: number = new CJS_Clobb_Class_NS.default().instNumber2();
var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string

// =================================== //
// == CommonJS Named Exports -> ES6 == //
// =================================== //

import { doesntExist3 } from "CommonJS_Named"; // Error: Not an exported binding

import { numberValue2 } from "CommonJS_Named";
var j1: number = numberValue2;
var j2: string = numberValue2; // Error: number ~> string

import { numberValue3 as numVal3 } from "CommonJS_Named";
var k1: number = numVal3;
var k2: string = numVal3; // Error: number ~> string

import * as CJS_Named from "CommonJS_Named";
var l1: number = CJS_Named.numberValue1;
var l2: string = CJS_Named.numberValue1; // Error: number ~> string
CJS_Named.doesntExist; // Error: doesntExist isn't a property

import * as CJS_Named_NS from "CommonJS_Named";
var m1: number = CJS_Named_NS.numberValue4;
var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export
var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string

//////////////////////////////
// == ES6 Default -> ES6 == //
//////////////////////////////

import { doesntExist4 } from "ES6_Default_AnonFunction1"; // Error: Not an exported binding

import ES6_Def_AnonFunc1 from "ES6_Default_AnonFunction1";
var n1: number = ES6_Def_AnonFunc1();
var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string

import ES6_Def_NamedFunc1 from "ES6_Default_NamedFunction1";
var o1: number = ES6_Def_NamedFunc1();
var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string

import ES6_Def_AnonClass1 from "ES6_Default_AnonClass1";
var p1: number = new ES6_Def_AnonClass1().givesANum();
var p2: string = new ES6_Def_AnonClass1().givesANum(); // Error: number ~> string

import ES6_Def_NamedClass1 from "ES6_Default_NamedClass1";
var q1: number = new ES6_Def_NamedClass1().givesANum();
var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string

////////////////////////////
// == ES6 Named -> ES6 == //
////////////////////////////

import doesntExist5 from "ES6_Named1"; // Error: Not an exported binding

import { specifierNumber1 as specifierNumber1_1 } from "ES6_Named1";
var r1: number = specifierNumber1_1;
var r2: string = specifierNumber1_1; // Error: number ~> string

import { specifierNumber2Renamed } from "ES6_Named1";
var s1: number = specifierNumber2Renamed;
var s2: string = specifierNumber2Renamed; // Error: number ~> string

import { specifierNumber3 as specifierNumber3Renamed } from "ES6_Named1";
var t1: number = specifierNumber3Renamed;
var t2: string = specifierNumber3Renamed; // Error: number ~> string

import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from "ES6_Named1";
var u1: number = groupedSpecifierNumber1;
var u2: number = groupedSpecifierNumber2;
var u3: string = groupedSpecifierNumber1; // Error: number ~> string
var u4: string = groupedSpecifierNumber2; // Error: number ~> string

import { givesANumber } from "ES6_Named1";
var v1: number = givesANumber();
var v2: string = givesANumber(); // Error: number ~> string

import { NumberGenerator } from "ES6_Named1";
var w1: number = new NumberGenerator().givesANumber();
var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string

import { varDeclNumber1, varDeclNumber2 } from "ES6_Named1";
var x1: number = varDeclNumber1;
var x2: number = varDeclNumber2;
var x3: string = varDeclNumber1; // Error: number ~> string
var x4: string = varDeclNumber2; // Error: number ~> string

import { destructuredObjNumber } from "ES6_Named1";
var y1: number = destructuredObjNumber;
var y2: string = destructuredObjNumber; // Error: number ~> string

import { destructuredArrNumber } from "ES6_Named1";
var z1: number = destructuredArrNumber;
var z2: string = destructuredArrNumber; // Error: number ~> string

import { numberValue1 as numberValue4 } from "ES6_ExportFrom_Intermediary1";
var aa1: number = numberValue4;
var aa2: string = numberValue4; // Error: number ~> string

import { numberValue2_renamed } from "ES6_ExportFrom_Intermediary1";
var ab1: number = numberValue2_renamed;
var ab2: string = numberValue2_renamed; // Error: number ~> string

import { numberValue1 as numberValue5 } from "ES6_ExportAllFrom_Intermediary1";
var ac1: number = numberValue5;
var ac2: string = numberValue5; // Error: number ~> string

///////////////////////////////////
// == ES6 Default -> CommonJS == //
///////////////////////////////////

require("ES6_Default_AnonFunction2").doesntExist; // Error: 'doesntExist' isn't an export

var ES6_Def_AnonFunc2 = require("ES6_Default_AnonFunction2").default;
var ad1: number = ES6_Def_AnonFunc2();
var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string

var ES6_Def_NamedFunc2 = require("ES6_Default_NamedFunction2").default;
var ae1: number = ES6_Def_NamedFunc2();
var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string

var ES6_Def_AnonClass2 = require("ES6_Default_AnonClass2").default;
var af1: number = new ES6_Def_AnonClass2().givesANum();
var af2: string = new ES6_Def_AnonClass2().givesANum(); // Error: number ~> string

var ES6_Def_NamedClass2 = require("ES6_Default_NamedClass2").default;
var ag1: number = new ES6_Def_NamedClass2().givesANum();
var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string

/////////////////////////////////
// == ES6 Named -> CommonJS == //
/////////////////////////////////

var specifierNumber4 = require("ES6_Named2").specifierNumber4;
var ah1: number = specifierNumber4;
var ah2: string = specifierNumber4; // Error: number ~> string

var specifierNumber5Renamed = require("ES6_Named2").specifierNumber5Renamed;
var ai1: number = specifierNumber5Renamed;
var ai2: string = specifierNumber5Renamed; // Error: number ~> string

var groupedSpecifierNumber3 = require("ES6_Named2").groupedSpecifierNumber3;
var groupedSpecifierNumber4 = require("ES6_Named2").groupedSpecifierNumber4;
var aj1: number = groupedSpecifierNumber3;
var aj2: number = groupedSpecifierNumber4;
var aj3: string = groupedSpecifierNumber3; // Error: number ~> string
var aj4: string = groupedSpecifierNumber4; // Error: number ~> string

var givesANumber2 = require("ES6_Named2").givesANumber2;
var ak1: number = givesANumber2();
var ak2: string = givesANumber2(); // Error: number ~> string

var NumberGenerator2 = require("ES6_Named2").NumberGenerator2;
var al1: number = new NumberGenerator2().givesANumber();
var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string

var varDeclNumber3 = require("ES6_Named2").varDeclNumber3;
var varDeclNumber4 = require("ES6_Named2").varDeclNumber4;
var am1: number = varDeclNumber3;
var am2: number = varDeclNumber4;
var am3: string = varDeclNumber3; // Error: number ~> string
var am4: string = varDeclNumber4; // Error: number ~> string

var destructuredObjNumber2 = require("ES6_Named2").destructuredObjNumber2;
var an1: number = destructuredObjNumber2;
var an2: string = destructuredObjNumber2; // Error: number ~> string

var destructuredArrNumber2 = require("ES6_Named2").destructuredArrNumber2;
var ao1: number = destructuredArrNumber2;
var ao2: string = destructuredArrNumber2; // Error: number ~> string

var numberValue6 = require("ES6_ExportFrom_Intermediary2").numberValue1;
var ap1: number = numberValue6;
var ap2: string = numberValue6; // Error: number ~> string

var numberValue2_renamed2 = require("ES6_ExportFrom_Intermediary2")
  .numberValue2_renamed2;
var aq1: number = numberValue2_renamed2;
var aq2: string = numberValue2_renamed2; // Error: number ~> string

var numberValue7 = require("ES6_ExportAllFrom_Intermediary2").numberValue2;
var ar1: number = numberValue7;
var ar2: string = numberValue7; // Error: number ~> string

////////////////////////////////////////////////////////
// == ES6 Default+Named -> ES6 import Default+Named== //
////////////////////////////////////////////////////////

import defaultNum, { str as namedStr } from "./ES6_DefaultAndNamed";

var as1: number = defaultNum;
var as2: string = defaultNum; // Error: number ~> string

var as3: string = namedStr;
var as4: number = namedStr; // Error: string ~> number

////////////////////////////////////////
// == Side-effect only ES6 imports == //
////////////////////////////////////////

import "./SideEffects";

//////////////////////////////////////////////
// == Suggest export name on likely typo == //
//////////////////////////////////////////////
import specifierNumber1 from "ES6_Named1"; // Error: Did you mean \`import {specifierNumber1} from ...\`?
import { specifierNumber } from "ES6_Named1"; // Error: Did you mean \`specifierNumber1\`?

///////////////////////////////////////////////////
// == Multi \`export *\` should combine exports == //
///////////////////////////////////////////////////
import {
  numberValue1 as numberValue8,
  numberValue2 as numberValue9
} from "./ES6_ExportAllFromMulti";

var at1: number = numberValue8;
var at2: string = numberValue8; // Error: number ~> string

var at3: number = numberValue9;
var at4: string = numberValue9; // Error: number ~> string

/////////////////////////////////////////////////////////////
// == Vanilla \`import\` cannot import a type-only export == //
/////////////////////////////////////////////////////////////
import { typeAlias } from "./ExportType"; // Error: Cannot vanilla-import a type alias!

================================================================================
`;

exports[`test_imports_are_frozen.js 1`] = `
====================================options=====================================
parsers: ["flow"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
/* @flow */

//
// Imports
//

// CommonJS module
import * as DefaultA from "A";
DefaultA.numberValue1 = 123; // Error: DefaultA is frozen

// ES6 module
import * as ES6_Named1 from "ES6_Named1";
ES6_Named1.varDeclNumber1 = 123; // Error: ES6_Named1 is frozen

// CommonJS module that clobbers module.exports
import * as CommonJS_Star from "CommonJS_Clobbering_Lit";
CommonJS_Star.numberValue1 = 123; // Error: frozen
CommonJS_Star.default.numberValue1 = 123; // ok

import CommonJS_Clobbering_Lit from "CommonJS_Clobbering_Lit";
CommonJS_Clobbering_Lit.numberValue1 = 123; // ok

// CommonJS module that clobbers module.exports with a frozen object
import * as CommonJS_Frozen_Star from "CommonJS_Clobbering_Frozen";
CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen
CommonJS_Frozen_Star.default.numberValue1 = 123; // Error: frozen

import CommonJS_Clobbering_Frozen from "CommonJS_Clobbering_Frozen";
CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen


//
// Requires
//

function testRequires() {
  // CommonJS module
  var DefaultA = require("A");
  DefaultA.numberValue1 = 123; // ok, not frozen by default

  // ES6 module
  var ES6_Named1 = require("ES6_Named1");
  ES6_Named1.numberValue = 123; // error, es6 exports are frozen

  // CommonJS module that clobbers module.exports
  var CommonJS_Star = require("CommonJS_Clobbering_Lit");
  CommonJS_Star.numberValue1 = 123; // ok, not frozen by default

  // CommonJS module that clobbers module.exports with a frozen object
  var CommonJS_Frozen_Star = require("CommonJS_Clobbering_Frozen");
  CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen
}

=====================================output=====================================
/* @flow */

//
// Imports
//

// CommonJS module
import * as DefaultA from "A";
DefaultA.numberValue1 = 123; // Error: DefaultA is frozen

// ES6 module
import * as ES6_Named1 from "ES6_Named1";
ES6_Named1.varDeclNumber1 = 123; // Error: ES6_Named1 is frozen

// CommonJS module that clobbers module.exports
import * as CommonJS_Star from "CommonJS_Clobbering_Lit";
CommonJS_Star.numberValue1 = 123; // Error: frozen
CommonJS_Star.default.numberValue1 = 123; // ok

import CommonJS_Clobbering_Lit from "CommonJS_Clobbering_Lit";
CommonJS_Clobbering_Lit.numberValue1 = 123; // ok

// CommonJS module that clobbers module.exports with a frozen object
import * as CommonJS_Frozen_Star from "CommonJS_Clobbering_Frozen";
CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen
CommonJS_Frozen_Star.default.numberValue1 = 123; // Error: frozen

import CommonJS_Clobbering_Frozen from "CommonJS_Clobbering_Frozen";
CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen

//
// Requires
//

function testRequires() {
  // CommonJS module
  var DefaultA = require("A");
  DefaultA.numberValue1 = 123; // ok, not frozen by default

  // ES6 module
  var ES6_Named1 = require("ES6_Named1");
  ES6_Named1.numberValue = 123; // error, es6 exports are frozen

  // CommonJS module that clobbers module.exports
  var CommonJS_Star = require("CommonJS_Clobbering_Lit");
  CommonJS_Star.numberValue1 = 123; // ok, not frozen by default

  // CommonJS module that clobbers module.exports with a frozen object
  var CommonJS_Frozen_Star = require("CommonJS_Clobbering_Frozen");
  CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen
}

================================================================================
`;
