// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ClassDeclaration22.ts - typescript-verify 1`] = ` class C { "foo"(); "bar"() { } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class C { foo(); bar() {} } `; exports[`anyIsAssignableToObject.ts - typescript-verify 1`] = ` interface P { p: {}; } interface Q extends P { // Check assignability here. Any is assignable to {} p: any; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interface P { p: {}; } interface Q extends P { // Check assignability here. Any is assignable to {} p: any; } `; exports[`castOfAwait.ts - typescript-verify 1`] = ` // @target: es6 async function f() { await 0; typeof await 0; void await 0; await void typeof void await 0; await await 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @target: es6 async function f() { await 0; typeof (await 0); void (await 0); await void (typeof (void (await 0))); await await 0; } `; exports[`castParentheses.ts - typescript-verify 1`] = ` class a { static b: any; } var b = (a); var b = (a).b; var b = (a.b).c; var b = (a.b()).c; var b = (new a); var b = (new a.b); var b = (new a).b ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class a { static b: any; } var b = a; var b = (a).b; var b = (a.b).c; var b = (a.b()).c; var b = new a(); var b = new a.b(); var b = (new a()).b; `; exports[`castTest.ts - typescript-verify 1`] = ` var x : any = 0; var z = x; var y = x + z; var a = 0; var b = true; var s = ""; var ar = null; var f = <(res : number) => void>null; declare class Point { x: number; y: number; add(dx: number, dy: number): Point; mult(p: Point): Point; constructor(x: number, y: number); } var p_cast = ({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: any = 0; var z = x; var y = x + z; var a = 0; var b = true; var s = ""; var ar = null; var f = <(res: number) => void>null; declare class Point { x: number; y: number; add(dx: number, dy: number): Point; mult(p: Point): Point; constructor(x: number, y: number); } var p_cast = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; } }; `; exports[`checkInfiniteExpansionTermination.ts - typescript-verify 1`] = ` // Regression test for #1002 // Before fix this code would cause infinite loop interface IObservable { n: IObservable; // Needed, must be T[] } // Needed interface ISubject extends IObservable { } interface Foo { x } interface Bar { y } var values: IObservable; var values2: ISubject; values = values2; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Regression test for #1002 // Before fix this code would cause infinite loop interface IObservable { n: IObservable; // Needed, must be T[] } // Needed interface ISubject extends IObservable {} interface Foo { x; } interface Bar { y; } var values: IObservable; var values2: ISubject; values = values2; `; exports[`commentInNamespaceDeclarationWithIdentifierPathName.ts - typescript-verify 1`] = ` namespace hello.hi.world { function foo() {} } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ namespace hello.hi.world { function foo() {} } `; exports[`commentsInterface.ts - typescript-verify 1`] = ` interface i2 { foo: (/**param help*/b: number) => string; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interface i2 { foo: (/**param help*/ b: number) => string; } `; exports[`contextualSignatureInstantiation2.ts - typescript-verify 1`] = ` // dot f g x = f(g(x)) var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)); var id: (x:T) => T; var r23 = dot(id)(id);~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // dot f g x = f(g(x)) var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; dot = (f: (_: T) => S) => (g: (_: U) => T): ((r: U) => S) => x => f(g(x)); var id: (x: T) => T; var r23 = dot(id)(id); `; exports[`declareDottedModuleName.ts - typescript-verify 1`] = ` // @declaration: true module M { module P.Q { } // This shouldnt be emitted } module M { export module R.S { } //This should be emitted } module T.U { // This needs to be emitted }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @declaration: true namespace M { namespace P.Q { } // This shouldnt be emitted } namespace M { export namespace R.S { } //This should be emitted } namespace T.U { // This needs to be emitted } `; exports[`decrementAndIncrementOperators.ts - typescript-verify 1`] = ` var x = 0; // errors 1 ++; (1)++; (1)--; ++(1); --(1); (1 + 2)++; (1 + 2)--; ++(1 + 2); --(1 + 2); (x + x)++; (x + x)--; ++(x + x); --(x + x); //OK x++; x--; ++x; --x; (x)++; --(x); ((x))++; ((x))--; x[x++]++; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x = 0; // errors 1++; 1++; 1--; ++1; --1; (1 + 2)++; (1 + 2)--; ++(1 + 2); --(1 + 2); (x + x)++; (x + x)--; ++(x + x); --(x + x); //OK x++; x--; ++x; --x; x++; --x; x++; x--; x[x++]++; `; exports[`downlevelLetConst1.ts - typescript-verify 1`] = ` const~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const; `; exports[`errorOnInitializerInInterfaceProperty.ts - typescript-verify 1`] = ` interface Foo { bar: number = 5; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interface Foo { bar: number = 5; } `; exports[`es5ExportDefaultClassDeclaration4.ts - typescript-verify 1`] = ` // @target: es5 // @module: commonjs // @declaration: true declare module "foo" { export var before: C; export default class C { method(): C; } export var after: C; export var t: typeof C; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @target: es5 // @module: commonjs // @declaration: true declare module "foo" { export var before: C; export default class C { method(): C; } export var after: C; export var t: typeof C; } `; exports[`functionOverloadsOnGenericArity1.ts - typescript-verify 1`] = ` // overloading on arity not allowed interface C { f(): string; f(): string; (): string; (): string; new (): string; new (): string; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // overloading on arity not allowed interface C { f(): string; f(): string; (): string; (): string; new (): string; new (): string; } `; exports[`globalIsContextualKeyword.ts - typescript-verify 1`] = ` function a() { let global = 1; } function b() { class global {} } namespace global { } function foo(global: number) { } let obj = { global: "123" }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function a() { let global = 1; } function b() { class global {} } namespace global { } function foo(global: number) {} let obj = { global: "123" }; `; exports[`indexSignatureWithInitializer.ts - typescript-verify 1`] = ` // These used to be indexers, now they are computed properties interface I { [x = '']: string; } class C { [x = 0]: string }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // These used to be indexers, now they are computed properties interface I { [x = ""]: string; } class C { [x = 0]: string; } `; exports[`mappedTypeWithCombinedTypeMappers.ts - typescript-verify 1`] = ` // Repro from #13351 type Meta = { [P in keyof T]: { value: T[P]; also: A; readonly children: Meta; }; } interface Input { x: string; y: number; } declare const output: Meta; const shouldFail: { important: boolean } = output.x.children; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Repro from #13351 type Meta = { [P in keyof T]: { value: T[P]; also: A; readonly children: Meta; } }; interface Input { x: string; y: number; } declare const output: Meta; const shouldFail: { important: boolean } = output.x.children; `; exports[`modifiersOnInterfaceIndexSignature1.ts - typescript-verify 1`] = ` interface I { public [a: string]: number; }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interface I { public [a: string]: number; } `; exports[`privacyGloImport.ts - typescript-verify 1`] = ` //@declaration: true module m1 { export module m1_M1_public { export class c1 { } export function f1() { return new c1; } export var v1 = c1; export var v2: c1; } module m1_M2_private { export class c1 { } export function f1() { return new c1; } export var v1 = c1; export var v2: c1; } //export declare module "m1_M3_public" { // export function f1(); // export class c1 { // } // export var v1: { new (): c1; }; // export var v2: c1; //} //declare module "m1_M4_private" { // export function f1(); // export class c1 { // } // export var v1: { new (): c1; }; // export var v2: c1; //} import m1_im1_private = m1_M1_public; export var m1_im1_private_v1_public = m1_im1_private.c1; export var m1_im1_private_v2_public = new m1_im1_private.c1(); export var m1_im1_private_v3_public = m1_im1_private.f1; export var m1_im1_private_v4_public = m1_im1_private.f1(); var m1_im1_private_v1_private = m1_im1_private.c1; var m1_im1_private_v2_private = new m1_im1_private.c1(); var m1_im1_private_v3_private = m1_im1_private.f1; var m1_im1_private_v4_private = m1_im1_private.f1(); import m1_im2_private = m1_M2_private; export var m1_im2_private_v1_public = m1_im2_private.c1; export var m1_im2_private_v2_public = new m1_im2_private.c1(); export var m1_im2_private_v3_public = m1_im2_private.f1; export var m1_im2_private_v4_public = m1_im2_private.f1(); var m1_im2_private_v1_private = m1_im2_private.c1; var m1_im2_private_v2_private = new m1_im2_private.c1(); var m1_im2_private_v3_private = m1_im2_private.f1; var m1_im2_private_v4_private = m1_im2_private.f1(); //import m1_im3_private = require("m1_M3_public"); //export var m1_im3_private_v1_public = m1_im3_private.c1; //export var m1_im3_private_v2_public = new m1_im3_private.c1(); //export var m1_im3_private_v3_public = m1_im3_private.f1; //export var m1_im3_private_v4_public = m1_im3_private.f1(); //var m1_im3_private_v1_private = m1_im3_private.c1; //var m1_im3_private_v2_private = new m1_im3_private.c1(); //var m1_im3_private_v3_private = m1_im3_private.f1; //var m1_im3_private_v4_private = m1_im3_private.f1(); //import m1_im4_private = require("m1_M4_private"); //export var m1_im4_private_v1_public = m1_im4_private.c1; //export var m1_im4_private_v2_public = new m1_im4_private.c1(); //export var m1_im4_private_v3_public = m1_im4_private.f1; //export var m1_im4_private_v4_public = m1_im4_private.f1(); //var m1_im4_private_v1_private = m1_im4_private.c1; //var m1_im4_private_v2_private = new m1_im4_private.c1(); //var m1_im4_private_v3_private = m1_im4_private.f1; //var m1_im4_private_v4_private = m1_im4_private.f1(); export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; //export import m1_im3_public = require("m1_M3_public"); //export import m1_im4_public = require("m1_M4_private"); } module glo_M1_public { export class c1 { } export function f1() { return new c1; } export var v1 = c1; export var v2: c1; } declare module "glo_M2_public" { export function f1(); export class c1 { } export var v1: { new (): c1; }; export var v2: c1; } declare module "use_glo_M1_public" { import use_glo_M1_public = glo_M1_public; export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; export var use_glo_M1_public_v2_public: typeof use_glo_M1_public; export var use_glo_M1_public_v3_public: ()=> use_glo_M1_public.c1; var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; }; var use_glo_M1_public_v2_private: typeof use_glo_M1_public; var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1; import use_glo_M2_public = require("glo_M2_public"); export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; }; export var use_glo_M2_public_v2_public: typeof use_glo_M2_public; export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; }; var use_glo_M2_public_v2_private: typeof use_glo_M2_public; var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; module m2 { //import errorImport = require("glo_M2_public"); import nonerrorImport = glo_M1_public; module m5 { //import m5_errorImport = require("glo_M2_public"); import m5_nonerrorImport = glo_M1_public; } } } declare module "anotherParseError" { module m2 { //declare module "abc" { //} } module m2 { //module "abc2" { //} } //module "abc3" { //} } module m2 { //import m3 = require("use_glo_M1_public"); module m4 { var a = 10; //import m2 = require("use_glo_M1_public"); } }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //@declaration: true namespace m1 { export namespace m1_M1_public { export class c1 {} export function f1() { return new c1(); } export var v1 = c1; export var v2: c1; } namespace m1_M2_private { export class c1 {} export function f1() { return new c1(); } export var v1 = c1; export var v2: c1; } //export declare module "m1_M3_public" { // export function f1(); // export class c1 { // } // export var v1: { new (): c1; }; // export var v2: c1; //} //declare module "m1_M4_private" { // export function f1(); // export class c1 { // } // export var v1: { new (): c1; }; // export var v2: c1; //} import m1_im1_private = m1_M1_public; export var m1_im1_private_v1_public = m1_im1_private.c1; export var m1_im1_private_v2_public = new m1_im1_private.c1(); export var m1_im1_private_v3_public = m1_im1_private.f1; export var m1_im1_private_v4_public = m1_im1_private.f1(); var m1_im1_private_v1_private = m1_im1_private.c1; var m1_im1_private_v2_private = new m1_im1_private.c1(); var m1_im1_private_v3_private = m1_im1_private.f1; var m1_im1_private_v4_private = m1_im1_private.f1(); import m1_im2_private = m1_M2_private; export var m1_im2_private_v1_public = m1_im2_private.c1; export var m1_im2_private_v2_public = new m1_im2_private.c1(); export var m1_im2_private_v3_public = m1_im2_private.f1; export var m1_im2_private_v4_public = m1_im2_private.f1(); var m1_im2_private_v1_private = m1_im2_private.c1; var m1_im2_private_v2_private = new m1_im2_private.c1(); var m1_im2_private_v3_private = m1_im2_private.f1; var m1_im2_private_v4_private = m1_im2_private.f1(); //import m1_im3_private = require("m1_M3_public"); //export var m1_im3_private_v1_public = m1_im3_private.c1; //export var m1_im3_private_v2_public = new m1_im3_private.c1(); //export var m1_im3_private_v3_public = m1_im3_private.f1; //export var m1_im3_private_v4_public = m1_im3_private.f1(); //var m1_im3_private_v1_private = m1_im3_private.c1; //var m1_im3_private_v2_private = new m1_im3_private.c1(); //var m1_im3_private_v3_private = m1_im3_private.f1; //var m1_im3_private_v4_private = m1_im3_private.f1(); //import m1_im4_private = require("m1_M4_private"); //export var m1_im4_private_v1_public = m1_im4_private.c1; //export var m1_im4_private_v2_public = new m1_im4_private.c1(); //export var m1_im4_private_v3_public = m1_im4_private.f1; //export var m1_im4_private_v4_public = m1_im4_private.f1(); //var m1_im4_private_v1_private = m1_im4_private.c1; //var m1_im4_private_v2_private = new m1_im4_private.c1(); //var m1_im4_private_v3_private = m1_im4_private.f1; //var m1_im4_private_v4_private = m1_im4_private.f1(); export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; //export import m1_im3_public = require("m1_M3_public"); //export import m1_im4_public = require("m1_M4_private"); } namespace glo_M1_public { export class c1 {} export function f1() { return new c1(); } export var v1 = c1; export var v2: c1; } declare module "glo_M2_public" { export function f1(); export class c1 {} export var v1: { new (): c1 }; export var v2: c1; } declare module "use_glo_M1_public" { import use_glo_M1_public = glo_M1_public; export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1 }; export var use_glo_M1_public_v2_public: typeof use_glo_M1_public; export var use_glo_M1_public_v3_public: () => use_glo_M1_public.c1; var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1 }; var use_glo_M1_public_v2_private: typeof use_glo_M1_public; var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1; import use_glo_M2_public = require("glo_M2_public"); export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1 }; export var use_glo_M2_public_v2_public: typeof use_glo_M2_public; export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1 }; var use_glo_M2_public_v2_private: typeof use_glo_M2_public; var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; namespace m2 { //import errorImport = require("glo_M2_public"); import nonerrorImport = glo_M1_public; namespace m5 { //import m5_errorImport = require("glo_M2_public"); import m5_nonerrorImport = glo_M1_public; } } } declare module "anotherParseError" { namespace m2 { //declare module "abc" { //} } namespace m2 { //module "abc2" { //} } //module "abc3" { //} } namespace m2 { //import m3 = require("use_glo_M1_public"); namespace m4 { var a = 10; //import m2 = require("use_glo_M1_public"); } } `;