void;
}

export interface ArrowRendererProps {
    /**
     * Arrow mouse down event handler.
     */
    onMouseDown: React.MouseEventHandler<any>;

    /**
     * whether the Select is open or not.
     */
    isOpen: boolean;
}

export interface ValueComponentProps<TValue = OptionValues> {
    disabled: ReactSelectProps<TValue>['disabled'];
    id: string;
    instancePrefix: string;
    onClick: OnValueClickHandler<TValue> | null;
    onRemove?: SelectValueHandler<TValue>;
    placeholder: ReactSelectProps<TValue>['placeholder'];
    value: Option<TValue>;
    values?: Array<Option<TValue>>;
}

export interface ReactSelectProps<TValue = OptionValues> extends React.Props<ReactSelectClass<TValue>> {
    /**
     * text to display when `allowCreate` is true.
     * @default 'Add "{label}"?'
     */
    addLabelText?: string;
    /**
     * renders a custom drop-down arrow to be shown in the right-hand side of the select.
     * @default undefined
     */
    arrowRenderer?: ArrowRendererHandler | null;
    /**
     * blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices.
     * @default false
     */
    autoBlur?: boolean;
    /**
     * autofocus the component on mount
     * @deprecated. Use autoFocus instead
     * @default false
     */
    autofocus?: boolean;
    /**
     * autofocus the component on mount
     * @default false
     */
    autoFocus?: boolean;
    /**
     *  If enabled, the input will expand as the length of its value increases
     */
    autosize?: boolean;
    /**
     * whether pressing backspace removes the last item when there is no input value
     * @default true
     */
    backspaceRemoves?: boolean;
    /**
     * Message to use for screenreaders to press backspace to remove the current item
     * {label} is replaced with the item label
     * @default "Press backspace to remove..."
     */
    backspaceToRemoveMessage?: string;
    /**
     * CSS className for the outer element
     */
    className?: string;
    /**
     * Prefix prepended to element default className if no className is defined
     */
    classNamePrefix?: string;
    /**
     * title for the "clear" control when `multi` is true
     * @default "Clear all"
     */
    clearAllText?: string;
    /**
     * Renders a custom clear to be shown in the right-hand side of the select when clearable true
     * @default undefined
     */
    clearRenderer?: ClearRendererHandler;
    /**
     * title for the "clear" control
     * @default "Clear value"
     */
    clearValueText?: string;
    /**
     * whether to close the menu when a value is selected
     * @default true
     */
    closeOnSelect?: boolean;
    /**
     * whether it is possible to reset value. if enabled, an X button will appear at the right side.
     * @default true
     */
    clearable?: boolean;
    /**
     * whether backspace removes an item if there is no text input
     * @default true
     */
    deleteRemoves?: boolean;
    /**
     * delimiter to use to join multiple values
     * @default ","
     */
    delimiter?: string;
    /**
     * whether the Select is disabled or not
     * @default false
     */
    disabled?: boolean;
    /**
     * whether escape clears the value when the menu is closed
     * @default true
     */
    escapeClearsValue?: boolean;
    /**
     * method to filter a single option
     */
    filterOption?: FilterOptionHandler<TValue>;
    /**
     * method to filter the options array
     */
    filterOptions?: FilterOptionsHandler<TValue>;
    /**
     * id for the underlying HTML input element
     * @default undefined
     */
    id?: string;
    /**
     * whether to strip diacritics when filtering
     * @default true
     */
    ignoreAccents?: boolean;
    /**
     * whether to perform case-insensitive filtering
     * @default true
     */
    ignoreCase?: boolean;
    /**
     * custom attributes for the Input (in the Select-control) e.g: {'data-foo': 'bar'}
     * @default {}
     */
    inputProps?: { [key: string]: any };
    /**
     * renders a custom input
     */
    inputRenderer?: InputRendererHandler;
    /**
     * allows for synchronization of component id's on server and client.
     * @see https://github.com/JedWatson/react-select/pull/1105
     */
    instanceId?: string;
    /**
     * whether the Select is loading externally or not (such as options being loaded).
     * if true, a loading spinner will be shown at the right side.
     * @default false
     */
    isLoading?: boolean;
    /**
     * (legacy mode) joins multiple values into a single form field with the delimiter
     * @default false
     */
    joinValues?: boolean;
    /**
     * the option property to use for the label
     * @default "label"
     */
    labelKey?: string;
    /**
     * (any, start) match the start or entire string when filtering
     * @default "any"
     */
    matchPos?: string;
    /**
     * (any, label, value) which option property to filter on
     * @default "any"
     */
    matchProp?: string;
    /**
     * buffer of px between the base of the dropdown and the viewport to shift if menu doesnt fit in viewport
     * @default 0
     */
    menuBuffer?: number;
    /**
     * optional style to apply to the menu container
     */
    menuContainerStyle?: React.CSSProperties;
    /**
     * renders a custom menu with options
     */
    menuRenderer?: MenuRendererHandler<TValue>;
    /**
     * optional style to apply to the menu
     */
    menuStyle?: React.CSSProperties;
    /**
     * multi-value input
     * @default false
     */
    multi?: boolean;
    /**
     * field name, for hidden `<input>` tag
     */
    name?: string;
    /**
     * placeholder displayed when there are no matching search results or a falsy value to hide it
     * @default "No results found"
     */
    noResultsText?: string | JSX.Element;
    /**
     * onBlur handler: function (event) {}
     */
    onBlur?: OnBlurHandler;
    /**
     * whether to clear input on blur or not
     * @default true
     */
    onBlurResetsInput?: boolean;
    /**
     * whether the input value should be reset when options are selected.
     * Also input value will be set to empty if 'onSelectResetsInput=true' and
     * Select will get new value that not equal previous value.
     * @default true
     */
    onSelectResetsInput?: boolean;
    /**
     * whether to clear input when closing the menu through the arrow
     * @default true
     */
    onCloseResetsInput?: boolean;
    /**
     * onChange handler: function (newValue) {}
     */
    onChange?: OnChangeHandler<TValue>;
    /**
     * fires when the menu is closed
     */
    onClose?: OnCloseHandler;
    /**
     * onFocus handler: function (event) {}
     */
    onFocus?: OnFocusHandler;
    /**
     * onInputChange handler: function (inputValue) {}
     */
    onInputChange?: OnInputChangeHandler;
    /**
     * onInputKeyDown handler: function (keyboardEvent) {}
     */
    onInputKeyDown?: OnInputKeyDownHandler;
    /**
     * fires when the menu is scrolled to the bottom; can be used to paginate options
     */
    onMenuScrollToBottom?: OnMenuScrollToBottomHandler;
    /**
     * fires when the menu is opened
     */
    onOpen?: OnOpenHandler;
    /**
     * boolean to enable opening dropdown when focused
     * @default false
     */
    openOnClick?: boolean;
    /**
     * open the options menu when the input gets focus (requires searchable = true)
     * @default true
     */
    openOnFocus?: boolean;
    /**
     * className to add to each option component
     */
    optionClassName?: string;
    /**
     * option component to render in dropdown
     */
    optionComponent?: OptionComponentType<TValue>;
    /**
     * function which returns a custom way to render the options in the menu
     */
    optionRenderer?: OptionRendererHandler<TValue>;
    /**
     * array of Select options
     * @default false
     */
    options?: Options<TValue>;
    /**
     * number of options to jump when using page up/down keys
     * @default 5
     */
    pageSize?: number;
    /**
     * field placeholder, displayed when there's no value
     * @default "Select..."
     */
    placeholder?: string | JSX.Element;
    /**
     * whether the selected option is removed from the dropdown on multi selects
     * @default true
     */
    removeSelected?: boolean;


parser509534.ts(2,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
parser509534.ts(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

==== parser509534.ts (2 errors) ====
    "use strict";
    var config = require("../config");
                 ~~~~~~~
!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
    module.exports.route = function (server) {
    ~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

     // General Login Page
     server.get(config.env.siteRoot + "/auth/login", function (req, res, next) {

      // TODO Should render login page that shows auth options
      req.redirect("/auth/live");
     });
    }


privateNameInObjectLiteral-3.ts(2,9): error TS18016: Private identifiers are not allowed outside class bodies.
privateNameInObjectLiteral-3.ts(2,9): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

==== privateNameInObjectLiteral-3.ts (2 errors) ====
    const obj = {
        get #foo() {
            ~~~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
            ~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
            return ""
        }
    };


//// [tests/cases/conformance/expressions/optionalChaining/propertyAccessChain/propertyAccessChain.ts] ////

//// [propertyAccessChain.ts]
declare const o1: undefined | { b: string };
o1?.b;

declare const o2: undefined | { b: { c: string } };
o2?.b.c;

declare const o3: { b: undefined | { c: string } };
o3.b?.c;

declare const o4: { b?: { c: { d?: { e: string } } } };
o4.b?.c.d?.e;

declare const o5: { b?(): { c: { d?: { e: string } } } };
o5.b?.().c.d?.e;

// GH#33744
declare const o6: <T>() => undefined | ({ x: number });
o6<number>()?.x;

// GH#34109
o1?.b ? 1 : 0;

// GH#36031
o2?.b!.c;
o2?.b!.c!;

//// [propertyAccessChain.js]
"use strict";
var _a, _b, _c, _d, _e, _f;
o1 === null || o1 === void 0 ? void 0 : o1.b;
o2 === null || o2 === void 0 ? void 0 : o2.b.c;
(_a = o3.b) === null || _a === void 0 ? void 0 : _a.c;
(_c = (_b = o4.b) === null || _b === void 0 ? void 0 : _b.c.d) === null || _c === void 0 ? void 0 : _c.e;
(_e = (_d = o5.b) === null || _d === void 0 ? void 0 : _d.call(o5).c.d) === null || _e === void 0 ? void 0 : _e.e;
(_f = o6()) === null || _f === void 0 ? void 0 : _f.x;
// GH#34109
(o1 === null || o1 === void 0 ? void 0 : o1.b) ? 1 : 0;
// GH#36031
o2 === null || o2 === void 0 ? void 0 : o2.b.c;
o2 === null || o2 === void 0 ? void 0 : o2.b.c;


a.ts(1,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.

==== tsconfig.json (0 errors) ====
    { "compilerOptions": {"types": []} }

==== a.ts (1 errors) ====
    module.exports = 1;
    ~~~~~~
!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.


/a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
/f.cts(1,1): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.
/main1.ts(1,13): error TS2305: Module '"./a"' has no exported member 'y'.
/main1.ts(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
/main1.ts(19,4): error TS2339: Property 'default' does not exist on type '() => void'.
/main1.ts(23,8): error TS1192: Module '"/e"' has no default export.
/main2.mts(1,13): error TS2305: Module '"./a"' has no exported member 'y'.
/main2.mts(4,4): error TS2339: Property 'default' does not exist on type 'typeof import("/a")'.
/main2.mts(5,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
/main2.mts(14,8): error TS1192: Module '"/e"' has no default export.
/main3.cjs(1,10): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
/main3.cjs(1,13): error TS2305: Module '"./a"' has no exported member 'y'.
/main3.cjs(2,1): error TS8002: 'import ... =' can only be used in TypeScript files.
/main3.cjs(5,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
/main3.cjs(8,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
/main3.cjs(10,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
/main3.cjs(12,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
/main3.cjs(14,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
/main3.cjs(17,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.


bug24934.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

==== bug24934.js (1 errors) ====
    export function abc(a, b, c) { return 5; }
    module.exports = { abc };
    ~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
==== use.js (0 errors) ====
    import { abc } from './bug24934';
    abc(1, 2, 3);


/a.ts(1,22): error TS7016: Could not find a declaration file for module '@foo/bar'. '/node_modules/@foo/bar/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/foo__bar` if it exists or add a new declaration (.d.ts) file containing `declare module '@foo/bar';`

==== /a.ts (1 errors) ====
    import * as foo from "@foo/bar";
                         ~~~~~~~~~~
!!! error TS7016: Could not find a declaration file for module '@foo/bar'. '/node_modules/@foo/bar/index.js' implicitly has an 'any' type.
!!! error TS7016:   Try `npm i --save-dev @types/foo__bar` if it exists or add a new declaration (.d.ts) file containing `declare module '@foo/bar';`

==== /node_modules/@foo/bar/package.json (0 errors) ====
    { "name": "@foo/bar", "version": "1.2.3" }

==== /node_modules/@foo/bar/index.js (0 errors) ====
    This file is not processed.


didYouMeanSuggestionErrors.ts(1,1): error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
didYouMeanSuggestionErrors.ts(2,5): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
didYouMeanSuggestionErrors.ts(3,19): error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.
didYouMeanSuggestionErrors.ts(7,1): error TS2582: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
didYouMeanSuggestionErrors.ts(8,5): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
didYouMeanSuggestionErrors.ts(9,9): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
didYouMeanSuggestionErrors.ts(9,21): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
didYouMeanSuggestionErrors.ts(10,9): error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
didYouMeanSuggestionErrors.ts(12,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
didYouMeanSuggestionErrors.ts(13,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
didYouMeanSuggestionErrors.ts(14,19): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
didYouMeanSuggestionErrors.ts(16,23): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
didYouMeanSuggestionErrors.ts(17,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
didYouMeanSuggestionErrors.ts(18,23): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
didYouMeanSuggestionErrors.ts(19,23): error TS2583: Cannot find name 'WeakSet'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
didYouMeanSuggestionErrors.ts(20,19): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
didYouMeanSuggestionErrors.ts(21,19): error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
didYouMeanSuggestionErrors.ts(23,18): error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
didYouMeanSuggestionErrors.ts(24,18): error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.

==== didYouMeanSuggestionErrors.ts (19 errors) ====
    describe("my test suite", () => {
    ~~~~~~~~
!!! error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
        it("should run", () => {
        ~~
!!! error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
            const a = $(".thing");
                      ~
!!! error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.
        });
    });

    suite("another suite", () => {
    ~~~~~
!!! error TS2582: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
        test("everything else", () => {
        ~~~~
!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
            console.log(process.env);
            ~~~~~~~
!!! error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
                        ~~~~~~~
!!! error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
            document.createElement("div");
            ~~~~~~~~
!!! error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.

            const x = require("fs");
                      ~~~~~~~
!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
            const y = Buffer.from([]);
                      ~~~~~~
!!! error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
            const z = module.exports;
                      ~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

            const a = new Map();
                          ~~~
!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
            const b = new Set();
                          ~~~
!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
            const c = new WeakMap();
                          ~~~~~~~
!!! error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
            const d = new WeakSet();
                          ~~~~~~~
!!! error TS2583: Cannot find name 'WeakSet'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
            const e = Symbol();
                      ~~~~~~
!!! error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.
            const f = Promise.resolve(0);
                      ~~~~~~~
!!! error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.

            const i: Iterator<any> = null as any;
                     ~~~~~~~~
!!! error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
            const j: AsyncIterator<any> = null as any;
                     ~~~~~~~~~~~~~
!!! error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
            const k: Symbol = null as any;
            const l: Promise<any> = null as any;
        });
    });


.map((arr) => arr.list)
>map : <U>(callbackfn: (value: { list?: MyObj[]; }, index: number, array: { list?: MyObj[]; }[]) => U, thisArg?: any) => U[]
>    : ^ ^^          ^^^     ^^^^^^^^^^^       ^^^^^     ^^      ^^     ^^^^^^^^^^^       ^^^^^^^^^^^^^       ^^^   ^^^^^^^^
>(arr) => arr.list : (arr: { list?: MyObj[]; }) => MyObj[] | undefined
>                  : ^   ^^^^^^^^^^^       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : { list?: MyObj[]; }
>    : ^^^^^^^^^       ^^^
>arr.list : MyObj[] | undefined
>         : ^^^^^^^^^^^^^^^^^^^
>arr : { list?: MyObj[]; }
>    : ^^^^^^^^^       ^^^
>list : MyObj[] | undefined
>     : ^^^^^^^^^^^^^^^^^^^

  .filter((arr) => arr && arr.length)
>filter : { <S extends MyObj[] | undefined>(predicate: (value: MyObj[] | undefined, index: number, array: (MyObj[] | undefined)[]) => value is S, thisArg?: any): S[]; (predicate: (value: MyObj[] | undefined, index: number, array: (MyObj[] | undefined)[]) => unknown, thisArg?: any): (MyObj[] | undefined)[]; }
>       : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^         ^^^     ^^^^^^^^^^^^^^^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^       ^^^   ^^^^^^^^^         ^^^     ^^^^^^^^^^^^^^^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^       ^^       ^^^   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>(arr) => arr && arr.length : (arr: MyObj[] | undefined) => number | undefined
>                           : ^   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : MyObj[] | undefined
>    : ^^^^^^^^^^^^^^^^^^^
>arr && arr.length : number | undefined
>                  : ^^^^^^^^^^^^^^^^^^
>arr : MyObj[] | undefined
>    : ^^^^^^^^^^^^^^^^^^^
>arr.length : number
>           : ^^^^^^
>arr : MyObj[]
>    : ^^^^^^^
>length : number
>       : ^^^^^^

  .map((arr) => arr // should error
>map : <U>(callbackfn: (value: MyObj[] | undefined, index: number, array: (MyObj[] | undefined)[]) => U, thisArg?: any) => U[]
>    : ^ ^^          ^^^     ^^^^^^^^^^^^^^^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^       ^^^   ^^^^^^^^
>(arr) => arr // should error    .filter((obj) => obj && obj.data)    .map(obj => JSON.parse(obj.data)) : (arr: MyObj[] | undefined) => any[]
>                                                                                : ^   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : MyObj[] | undefined
>    : ^^^^^^^^^^^^^^^^^^^
>arr // should error    .filter((obj) => obj && obj.data)    .map(obj => JSON.parse(obj.data)) : any[]
>                                                                                : ^^^^^
>arr // should error    .filter((obj) => obj && obj.data)    .map : <U>(callbackfn: (value: MyObj, index: number, array: MyObj[]) => U, thisArg?: any) => U[]
>                                                                 : ^ ^^          ^^^     ^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^       ^^^   ^^^^^^^^
>arr // should error    .filter((obj) => obj && obj.data) : MyObj[]
>                                                         : ^^^^^^^
>arr // should error    .filter : { <S extends MyObj>(predicate: (value: MyObj, index: number, array: MyObj[]) => value is S, thisArg?: any): S[]; (predicate: (value: MyObj, index: number, array: MyObj[]) => unknown, thisArg?: any): MyObj[]; }
>                               : ^^^ ^^^^^^^^^^^^^^^^         ^^^     ^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^       ^^^   ^^^^^^^^^         ^^^     ^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^       ^^       ^^^   ^^^^^^^^^^^^^
>arr : MyObj[] | undefined
>    : ^^^^^^^^^^^^^^^^^^^

    .filter((obj) => obj && obj.data)
>filter : { <S extends MyObj>(predicate: (value: MyObj, index: number, array: MyObj[]) => value is S, thisArg?: any): S[]; (predicate: (value: MyObj, index: number, array: MyObj[]) => unknown, thisArg?: any): MyObj[]; }
>       : ^^^ ^^^^^^^^^^^^^^^^         ^^^     ^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^       ^^^   ^^^^^^^^^         ^^^     ^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^       ^^       ^^^   ^^^^^^^^^^^^^
>(obj) => obj && obj.data : (obj: MyObj) => string | undefined
>                         : ^   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>obj : MyObj
>    : ^^^^^
>obj && obj.data : string | undefined
>                : ^^^^^^^^^^^^^^^^^^
>obj : MyObj
>    : ^^^^^
>obj.data : string | undefined
>         : ^^^^^^^^^^^^^^^^^^
>obj : MyObj
>    : ^^^^^
>data : string | undefined
>     : ^^^^^^^^^^^^^^^^^^

    .map(obj => JSON.parse(obj.data))  // should error
>map : <U>(callbackfn: (value: MyObj, index: number, array: MyObj[]) => U, thisArg?: any) => U[]
>    : ^ ^^          ^^^     ^^^^^^^^^     ^^      ^^     ^^^^^^^^^^^^^^^^^       ^^^   ^^^^^^^^
>obj => JSON.parse(obj.data) : (obj: MyObj) => any
>                            : ^   ^^^^^^^^^^^^^^^
>obj : MyObj
>    : ^^^^^
>JSON.parse(obj.data) : any
>                     : ^^^
>JSON.parse : (text: string, reviver?: (this: any, key: string, value: any) => any) => any
>           : ^    ^^      ^^       ^^^                                           ^^^^^
>JSON : JSON
>     : ^^^^
>parse : (text: string, reviver?: (this: any, key: string, value: any) => any) => any
>      : ^    ^^      ^^       ^^^                                           ^^^^^
>obj.data : string | undefined
>         : ^^^^^^^^^^^^^^^^^^
>obj : MyObj
>    : ^^^^^
>data : string | undefined
>     : ^^^^^^^^^^^^^^^^^^

  );


o2?.f(x);
>o2?.f(x) : boolean
>         : ^^^^^^^
>o2?.f : (x: any) => x is number
>      : ^ ^^   ^^^^^
>o2 : { f(x: any): x is number; }
>   : ^^^^ ^^   ^^^           ^^^
>f : (x: any) => x is number
>  : ^ ^^   ^^^^^
>x : number
>  : ^^^^^^
}
else {
    x;
>x : string | number
>  : ^^^^^^^^^^^^^^^

    o2;
>o2 : { f(x: any): x is number; } | undefined
>   : ^^^^ ^^   ^^^           ^^^^^^^^^^^^^^^

    o2?.f;
>o2?.f : ((x: any) => x is number) | undefined
>      : ^^ ^^   ^^^^^           ^^^^^^^^^^^^^
>o2 : { f(x: any): x is number; } | undefined
>   : ^^^^ ^^   ^^^           ^^^^^^^^^^^^^^^
>f : ((x: any) => x is number) | undefined
>  : ^^ ^^   ^^^^^           ^^^^^^^^^^^^^

    o2.f;
>o2.f : (x: any) => x is number
>     : ^ ^^   ^^^^^
>o2 : { f(x: any): x is number; } | undefined
>   : ^^^^ ^^   ^^^           ^^^^^^^^^^^^^^^
>f : (x: any) => x is number
>  : ^ ^^   ^^^^^
}
x;
>x : string | number
>  : ^^^^^^^^^^^^^^^

o2;
>o2 : { f(x: any): x is number; } | undefined
>   : ^^^^ ^^   ^^^           ^^^^^^^^^^^^^^^

o2?.f;
>o2?.f : ((x: any) => x is number) | undefined
>      : ^^ ^^   ^^^^^           ^^^^^^^^^^^^^
>o2 : { f(x: any): x is number; } | undefined
>   : ^^^^ ^^   ^^^           ^^^^^^^^^^^^^^^
>f : ((x: any) => x is number) | undefined
>  : ^^ ^^   ^^^^^           ^^^^^^^^^^^^^

o2.f;
>o2.f : (x: any) => x is number
>     : ^ ^^   ^^^^^
>o2 : { f(x: any): x is number; } | undefined
>   : ^^^^ ^^   ^^^           ^^^^^^^^^^^^^^^
>f : (x: any) => x is number
>  : ^ ^^   ^^^^^

declare const o3: { x: 1, y: string } | { x: 2, y: number } | undefined;
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^ ^^^^^      ^^^^^^^^^^^^^^^
>x : 1
>  : ^
>y : string
>  : ^^^^^^
>x : 2
>  : ^
>y : number
>  : ^^^^^^

if (o3?.x === 1) {
>o3?.x === 1 : boolean
>            : ^^^^^^^
>o3?.x : 1 | 2 | undefined
>      : ^^^^^^^^^^^^^^^^^
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^ ^^^^^      ^^^^^^^^^^^^^^^
>x : 1 | 2 | undefined
>  : ^^^^^^^^^^^^^^^^^
>1 : 1
>  : ^

    o3;
>o3 : { x: 1; y: string; }
>   : ^^^^^ ^^^^^      ^^^

    o3.x;
>o3.x : 1
>     : ^
>o3 : { x: 1; y: string; }
>   : ^^^^^ ^^^^^      ^^^
>x : 1
>  : ^

    o3?.x;
>o3?.x : 1
>      : ^
>o3 : { x: 1; y: string; }
>   : ^^^^^ ^^^^^      ^^^
>x : 1
>  : ^
}
else {
    o3;
>o3 : { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^^^^^

    o3?.x;
>o3?.x : 2 | undefined
>      : ^^^^^^^^^^^^^
>o3 : { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^^^^^
>x : 2 | undefined
>  : ^^^^^^^^^^^^^

    o3.x;
>o3.x : 2
>     : ^
>o3 : { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^^^^^
>x : 2
>  : ^
}
o3;
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^ ^^^^^      ^^^^^^^^^^^^^^^

o3?.x;
>o3?.x : 1 | 2 | undefined
>      : ^^^^^^^^^^^^^^^^^
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^ ^^^^^      ^^^^^^^^^^^^^^^
>x : 1 | 2 | undefined
>  : ^^^^^^^^^^^^^^^^^

o3.x;
>o3.x : 1 | 2
>     : ^^^^^
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>   : ^^^^^ ^^^^^      ^^^^^^^^^^^ ^^^^^      ^^^^^^^^^^^^^^^
>x : 1 | 2
>  : ^^^^^

declare const o4: { x?: { y: boolean } };
>o4 : { x?: { y: boolean; }; }
>   : ^^^^^^               ^^^
>x : { y: boolean; } | undefined
>  : ^^^^^       ^^^^^^^^^^^^^^^
>y : boolean
>  : ^^^^^^^

if (o4.x?.y) {
>o4.x?.y : boolean | undefined
>        : ^^^^^^^^^^^^^^^^^^^
>o4.x : { y: boolean; } | undefined
>     : ^^^^^       ^^^^^^^^^^^^^^^
>o4 : { x?: { y: boolean; }; }
>   : ^^^^^^               ^^^
>x : { y: boolean; } | undefined
>  : ^^^^^       ^^^^^^^^^^^^^^^
>y : boolean | undefined
>  : ^^^^^^^^^^^^^^^^^^^

    o4.x; // { y: boolean }
>o4.x : { y: boolean; }
>     : ^^^^^       ^^^
>o4 : { x?: { y: boolean; }; }
>   : ^^^^^^               ^^^
>x : { y: boolean; }
>  : ^^^^^       ^^^

    o4.x.y; // true
>o4.x.y : true
>       : ^^^^
>o4.x : { y: boolean; }
>     : ^^^^^       ^^^
>o4 : { x?: { y: boolean; }; }
>   : ^^^^^^               ^^^
>x : { y: boolean; }
>  : ^^^^^       ^^^
>y : true
>  : ^^^^

    o4.x?.y; // true
>o4.x?.y : true
>        : ^^^^
>o4.x : { y: boolean; }
>     : ^^^^^       ^^^
>o4 : { x?: { y: boolean; }; }
>   : ^^^^^^               ^^^
>x : { y: boolean; }
>  : ^^^^^       ^^^
>y : true
>  : ^^^^
}
else {
    o4.x;
>o4.x : { y: boolean; } | undefined
>     : ^^^^^       ^^^^^^^^^^^^^^^
>o4 : { x?: { y: boolean; }; }
>   : ^^^^^^               ^^^
>x : { y: boolean; } | undefined
>  : ^^^^^       ^^^^^^^^^^^^^^^


privateNamesNotAllowedInVariableDeclarations.ts(1,7): error TS18029: Private identifiers are not allowed in variable declarations.

==== privateNamesNotAllowedInVariableDeclarations.ts (1 errors) ====
    const #foo = 3;
          ~~~~
!!! error TS18029: Private identifiers are not allowed in variable declarations.


><U>(u: U, update: (u: U) => T) => {        const set = (newU: U) => Object.is(u, newU) ? t : update(newU);        return Object.assign(            <K extends Key<U>>(key: K) =>                reduce<Value<K, U>>(u[key as keyof U] as Value<K, U>, (v: Value<K, U>) => {                    return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }));                }),            { map: (updater: (u: U) => U) => set(updater(u)), set });    } : <U>(u: U, update: (u: U) => T) => (<K extends Key<U>>(key: K) => (<K_1 extends keyof Value<K, U>>(key: K_1) => (<K_2 extends keyof Value<K_1, Value<K, U>>>(key: K_2) => (<K_3 extends keyof Value<K_2, Value<K_1, Value<K, U>>>>(key: K_3) => (<K_4 extends keyof Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>(key: K_4) => (<K_5 extends keyof Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>(key: K_5) => (<K_6 extends keyof Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>(key: K_6) => (<K_7 extends keyof Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>(key: K_7) => (<K_8 extends keyof Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>(key: K_8) => (<K_9 extends keyof Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>(key: K_9) => (<K_10 extends keyof Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>>(key: K_10) => any & { map: (updater: (u: Value<K_10, Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>>) => Value<K_10, Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>>) => T; set: (newU: Value<K_10, Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>) => Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>) => T; set: (newU: Value<K_9, Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>) => Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>) => T; set: (newU: Value<K_8, Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>) => Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>) => T; set: (newU: Value<K_7, Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>>) => T; }) & { map: (updater: (u: Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>) => Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>) => T; set: (newU: Value<K_6, Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>>) => T; }) & { map: (updater: (u: Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>) => Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>) => T; set: (newU: Value<K_5, Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>>) => T; }) & { map: (updater: (u: Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>) => Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>) => T; set: (newU: Value<K_4, Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>>) => T; }) & { map: (updater: (u: Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>) => Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>) => T; set: (newU: Value<K_3, Value<K_2, Value<K_1, Value<K, U>>>>) => T; }) & { map: (updater: (u: Value<K_2, Value<K_1, Value<K, U>>>) => Value<K_2, Value<K_1, Value<K, U>>>) => T; set: (newU: Value<K_2, Value<K_1, Value<K, U>>>) => T; }) & { map: (updater: (u: Value<K_1, Value<K, U>>) => Value<K_1, Value<K, U>>) => T; set: (newU: Value<K_1, Value<K, U>>) => T; }) & { map: (updater: (u: Value<K, U>) => Value<K, U>) => T; set: (newU: Value<K, U>) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; }


//// [tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty2.ts] ////

//// [mappedTypeWithAsClauseAndLateBoundProperty2.ts]
export const thing = (null! as { [K in keyof number[] as Exclude<K, "length">]: (number[])[K] }) satisfies any;

//// [mappedTypeWithAsClauseAndLateBoundProperty2.js]
export const thing = null;

//// [mappedTypeWithAsClauseAndLateBoundProperty2.d.ts]
export declare const thing: {
    [x: number]: number;
    toString: () => string;
    toLocaleString: {
        (): string;
        (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
    };
    pop: () => number;
    push: (...items: number[]) => number;
    concat: {
        (...items: ConcatArray<number>[]): number[];
        (...items: (number | ConcatArray<number>)[]): number[];
    };
    join: (separator?: string) => string;
    reverse: () => number[];
    shift: () => number;
    slice: (start?: number, end?: number) => number[];
    sort: (compareFn?: (a: number, b: number) => number) => number[];
    splice: {
        (start: number, deleteCount?: number): number[];
        (start: number, deleteCount: number, ...items: number[]): number[];
    };
    unshift: (...items: number[]) => number;
    indexOf: (searchElement: number, fromIndex?: number) => number;
    lastIndexOf: (searchElement: number, fromIndex?: number) => number;
    every: {
        <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[];
        (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean;
    };
    some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean;
    forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void;
    map: <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[];
    filter: {
        <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[];
        (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[];
    };
    reduce: {
        (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number;
        (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number;
        <U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U;
    };
    reduceRight: {
        (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number;
        (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number;
        <U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U;
    };
    find: {
        <S extends number>(predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S;
        (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number;
    };
    findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number;
    fill: (value: number, start?: number, end?: number) => number[];
    copyWithin: (target: number, start: number, end?: number) => number[];
    entries: () => ArrayIterator<[number, number]>;
    keys: () => ArrayIterator<number>;
    values: () => ArrayIterator<number>;
    includes: (searchElement: number, fromIndex?: number) => boolean;
    flatMap: <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[];
    flat: <A, D extends number = 1>(this: A, depth?: D) => FlatArray<A, D>[];
    [Symbol.iterator]: () => ArrayIterator<number>;
    readonly [Symbol.unscopables]: {
        [x: number]: boolean;
        length?: boolean;
        toString?: boolean;
        toLocaleString?: boolean;
        pop?: boolean;
        push?: boolean;
        concat?: boolean;
        join?: boolean;
        reverse?: boolean;
        shift?: boolean;
        slice?: boolean;
        sort?: boolean;
        splice?: boolean;
        unshift?: boolean;
        indexOf?: boolean;
        lastIndexOf?: boolean;
        every?: boolean;
        some?: boolean;
        forEach?: boolean;
        map?: boolean;
        filter?: boolean;
        reduce?: boolean;
        reduceRight?: boolean;
        find?: boolean;
        findIndex?: boolean;
        fill?: boolean;
        copyWithin?: boolean;
        entries?: boolean;
        keys?: boolean;
        values?: boolean;
        includes?: boolean;
        flatMap?: boolean;
        flat?: boolean;
        [Symbol.iterator]?: boolean;
        readonly [Symbol.unscopables]?: boolean;
    };
};


/**
      * Performs the specified action for each element in an array.
      * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
      * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
      */
    forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
>forEach : (callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void
>        : ^          ^^                                             ^^       ^^^   ^^^^^
>callbackfn : (value: T, index: number, array: T[]) => void
>           : ^     ^^ ^^     ^^      ^^     ^^   ^^^^^
>value : T
>      : ^
>index : number
>      : ^^^^^^
>array : T[]
>      : ^^^
>thisArg : any

    /**
      * Calls a defined callback function on each element of an array, and returns an array that contains the results.
      * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
      * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
      */
    map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
>map : <U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]
>    : ^ ^^          ^^                                          ^^       ^^^   ^^^^^
>callbackfn : (value: T, index: number, array: T[]) => U
>           : ^     ^^ ^^     ^^      ^^     ^^   ^^^^^
>value : T
>      : ^
>index : number
>      : ^^^^^^
>array : T[]
>      : ^^^
>thisArg : any

    /**
      * Returns the elements of an array that meet the condition specified in a callback function.
      * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
      * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
      */
    filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
>filter : (callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => T[]
>       : ^          ^^                                                ^^       ^^^   ^^^^^
>callbackfn : (value: T, index: number, array: T[]) => boolean
>           : ^     ^^ ^^     ^^      ^^     ^^   ^^^^^
>value : T
>      : ^
>index : number
>      : ^^^^^^
>array : T[]
>      : ^^^
>thisArg : any

    /**
      * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
      */
    reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
>reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }
>       : ^^^          ^^                                                                          ^^            ^^^ ^^^ ^^^ ^^          ^^                                                                          ^^            ^^ ^^^ ^^^
>callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T
>           : ^             ^^ ^^            ^^ ^^            ^^      ^^     ^^   ^^^^^
>previousValue : T
>              : ^
>currentValue : T
>             : ^
>currentIndex : number
>             : ^^^^^^
>array : T[]
>      : ^^^
>initialValue : T
>             : ^

    /**
      * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
      */
    reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
>reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }
>       : ^^^          ^^                                                                          ^^            ^^^ ^^^ ^^^ ^^          ^^                                                                          ^^            ^^ ^^^ ^^^
>callbackfn : (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U
>           : ^             ^^ ^^            ^^ ^^            ^^      ^^     ^^   ^^^^^
>previousValue : U
>              : ^
>currentValue : T
>             : ^
>currentIndex : number
>             : ^^^^^^
>array : T[]
>      : ^^^
>initialValue : U
>             : ^

    /**
      * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
      */
    reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
>reduceRight : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }
>            : ^^^          ^^                                                                          ^^            ^^^ ^^^ ^^^ ^^          ^^                                                                          ^^            ^^ ^^^ ^^^
>callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T
>           : ^             ^^ ^^            ^^ ^^            ^^      ^^     ^^   ^^^^^
>previousValue : T
>              : ^
>currentValue : T
>             : ^
>currentIndex : number
>             : ^^^^^^
>array : T[]
>      : ^^^
>initialValue : T
>             : ^


privateNameES5Ban.ts(3,5): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(4,5): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(5,12): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(6,12): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(7,9): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(8,9): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(9,16): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateNameES5Ban.ts(10,16): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

==== privateNameES5Ban.ts (8 errors) ====
    class A {
        constructor() {}
        #field = 123;
        ~~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        #method() {}
        ~~~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        static #sField = "hello world";
               ~~~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        static #sMethod() {}
               ~~~~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        get #acc() { return ""; }
            ~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        set #acc(x: string) {}
            ~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        static get #sAcc() { return 0; }
                   ~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
        static set #sAcc(x: number) {}
                   ~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
    }


//// [tests/cases/compiler/indexedAccessAndNullableNarrowing.ts] ////

=== indexedAccessAndNullableNarrowing.ts ===
function f1<T extends Record<string, any>, K extends keyof T>(x: T[K] | undefined) {
>f1 : <T extends Record<string, any>, K extends keyof T>(x: T[K] | undefined) => void
>   : ^ ^^^^^^^^^                   ^^ ^^^^^^^^^       ^^ ^^                ^^^^^^^^^
>x : T[K] | undefined
>  : ^^^^^^^^^^^^^^^^

    if (x === undefined) return;
>x === undefined : boolean
>                : ^^^^^^^
>x : T[K] | undefined
>  : ^^^^^^^^^^^^^^^^
>undefined : undefined
>          : ^^^^^^^^^

    x;  // T[K] & ({} | null)
>x : T[K] & ({} | null)
>  : ^^^^^^^^^^^^^^^^^^

    if (x === undefined) return;
>x === undefined : boolean
>                : ^^^^^^^
>x : T[K] & ({} | null)
>  : ^^^^^^^^^^^^^^^^^^
>undefined : undefined
>          : ^^^^^^^^^

    x;  // T[K] & ({} | null)
>x : T[K] & ({} | null)
>  : ^^^^^^^^^^^^^^^^^^
}

function f2<T extends Record<string, any>, K extends keyof T>(x: T[K] | null) {
>f2 : <T extends Record<string, any>, K extends keyof T>(x: T[K] | null) => void
>   : ^ ^^^^^^^^^                   ^^ ^^^^^^^^^       ^^ ^^           ^^^^^^^^^
>x : T[K] | null
>  : ^^^^^^^^^^^

    if (x === null) return;
>x === null : boolean
>           : ^^^^^^^
>x : T[K] | null
>  : ^^^^^^^^^^^

    x;  // T[K] & ({} | undefined)
>x : T[K] & ({} | undefined)
>  : ^^^^^^^^^^^^^^^^^^^^^^^

    if (x === null) return;
>x === null : boolean
>           : ^^^^^^^
>x : T[K] & ({} | undefined)
>  : ^^^^^^^^^^^^^^^^^^^^^^^

    x;  // T[K] & ({} | undefined)
>x : T[K] & ({} | undefined)
>  : ^^^^^^^^^^^^^^^^^^^^^^^
}

function f3<T, K extends keyof T>(t: T[K], p1: Partial<T>[K] & {}, p2: Partial<T>[K] & ({} | null)) {
>f3 : <T, K extends keyof T>(t: T[K], p1: Partial<T>[K] & {}, p2: Partial<T>[K] & ({} | null)) => void
>   : ^ ^^ ^^^^^^^^^       ^^ ^^    ^^  ^^                  ^^  ^^                           ^^^^^^^^^
>t : T[K]
>  : ^^^^
>p1 : Partial<T>[K] & {}
>   : ^^^^^^^^^^^^^^^^^^
>p2 : Partial<T>[K] & ({} | null)
>   : ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    t = p1;
>t = p1 : Partial<T>[K] & {}
>       : ^^^^^^^^^^^^^^^^^^
>t : T[K]
>  : ^^^^
>p1 : Partial<T>[K] & {}
>   : ^^^^^^^^^^^^^^^^^^

    t = p2;
>t = p2 : Partial<T>[K] & ({} | null)
>       : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>t : T[K]
>  : ^^^^
>p2 : Partial<T>[K] & ({} | null)
>   : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

// https://github.com/microsoft/TypeScript/issues/57693

type AnyObject = Record<string, any>;
>AnyObject : AnyObject
>          : ^^^^^^^^^

type State = AnyObject;
>State : AnyObject
>      : ^^^^^^^^^

declare function hasOwnProperty<T extends AnyObject>(
>hasOwnProperty : <T extends AnyObject>(object: T, prop: PropertyKey) => prop is keyof T
>               : ^ ^^^^^^^^^         ^^      ^^ ^^    ^^           ^^^^^

    object: T,
>object : T
>       : ^

    prop: PropertyKey,
>prop : PropertyKey
>     : ^^^^^^^^^^^

): prop is keyof T;

interface Store<S = State> {
    setState<K extends keyof S>(key: K, value: S[K]): void;
>setState : <K extends keyof S>(key: K, value: S[K]) => void
>         : ^ ^^^^^^^^^       ^^   ^^ ^^     ^^    ^^^^^
>key : K
>    : ^
>value : S[K]
>      : ^^^^
}

export function syncStoreProp<
>syncStoreProp : <S extends State, P extends Partial<S>, K extends keyof S>(store: Store<S>, props: P, key: K) => void
>              : ^ ^^^^^^^^^     ^^ ^^^^^^^^^          ^^ ^^^^^^^^^       ^^     ^^        ^^     ^^ ^^   ^^ ^^^^^^^^^

    S extends State,
    P extends Partial<S>,
    K extends keyof S,
>(store: Store<S>, props: P, key: K) {
>store : Store<S>
>      : ^^^^^^^^
>props : P
>      : ^
>key : K
>    : ^

    const value = hasOwnProperty(props, key) ? props[key] : undefined;
>value : P[K] | undefined
>      : ^^^^^^^^^^^^^^^^
>hasOwnProperty(props, key) ? props[key] : undefined : P[K] | undefined
>                                                    : ^^^^^^^^^^^^^^^^
>hasOwnProperty(props, key) : boolean
>                           : ^^^^^^^
>hasOwnProperty : <T extends AnyObject>(object: T, prop: PropertyKey) => prop is keyof T
>               : ^ ^^^^^^^^^         ^^      ^^ ^^    ^^           ^^^^^
>props : P
>      : ^
>key : string | number | symbol
>    : ^^^^^^^^^^^^^^^^^^^^^^^^
>props[key] : P[K]
>           : ^^^^
>props : P
>      : ^
>key : K
>    : ^
>undefined : undefined
>          : ^^^^^^^^^

    if (value === undefined) return;
>value === undefined : boolean
>                    : ^^^^^^^
>value : P[K] | undefined
>      : ^^^^^^^^^^^^^^^^
>undefined : undefined
>          : ^^^^^^^^^

    store.setState(key, value);
>store.setState(key, value) : void
>                           : ^^^^
>store.setState : <K_1 extends keyof S>(key: K_1, value: S[K_1]) => void
>               : ^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^     ^^^^^^^^^^^^^
>store : Store<S>
>      : ^^^^^^^^
>setState : <K_1 extends keyof S>(key: K_1, value: S[K_1]) => void
>         : ^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^     ^^^^^^^^^^^^^
>key : K
>    : ^
>value : P[K] & ({} | null)
>      : ^^^^^^^^^^^^^^^^^^

    if (value === undefined) return;
>value === undefined : boolean
>                    : ^^^^^^^
>value : P[K] & ({} | null)
>      : ^^^^^^^^^^^^^^^^^^
>undefined : undefined
>          : ^^^^^^^^^

    store.setState(key, value);
>store.setState(key, value) : void
>                           : ^^^^
>store.setState : <K_1 extends keyof S>(key: K_1, value: S[K_1]) => void
>               : ^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^     ^^^^^^^^^^^^^
>store : Store<S>
>      : ^^^^^^^^
>setState : <K_1 extends keyof S>(key: K_1, value: S[K_1]) => void
>         : ^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^     ^^^^^^^^^^^^^
>key : K
>    : ^
>value : P[K] & ({} | null)
>      : ^^^^^^^^^^^^^^^^^^
}


a.ts(2,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
main.ts(1,20): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.

==== a.ts (1 errors) ====
    class a { }
    export = a;
    ~~~~~~~~~~~
!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.

==== main.ts (1 errors) ====
    import * as a from "./a";
                       ~~~~~
!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.
    a;


static filter<R>(dit: typeof Promise, values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>;
>filter : { <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1>[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1>[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; }
>       : ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                          ^^^              ^^^ ^^   ^^              ^^      ^^                     ^^        ^^                                                                          ^^^            ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                          ^^^              ^^^
>dit : typeof Promise
>    : ^^^^^^^^^^^^^^
>Promise : typeof Promise
>        : ^^^^^^^^^^^^^^
>values : Promise.Thenable<R[]>
>       : ^^^^^^^^^^^^^^^^^^^^^
>Promise : any
>        : ^^^
>filterer : (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>
>         : ^    ^^ ^^     ^^      ^^           ^^      ^^^^^
>item : R
>     : ^
>index : number
>      : ^^^^^^
>arrayLength : number
>            : ^^^^^^
>Promise : any
>        : ^^^

    static filter<R>(dit: typeof Promise, values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
>filter : { <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1>[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1>[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; }
>       : ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                                            ^^^              ^^^ ^^   ^^              ^^      ^^                     ^^        ^^                                                        ^^^            ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                          ^^^              ^^^
>dit : typeof Promise
>    : ^^^^^^^^^^^^^^
>Promise : typeof Promise
>        : ^^^^^^^^^^^^^^
>values : Promise.Thenable<R[]>
>       : ^^^^^^^^^^^^^^^^^^^^^
>Promise : any
>        : ^^^
>filterer : (item: R, index: number, arrayLength: number) => boolean
>         : ^    ^^ ^^     ^^      ^^           ^^      ^^^^^
>item : R
>     : ^
>index : number
>      : ^^^^^^
>arrayLength : number
>            : ^^^^^^


static filter<R>(dit: typeof Promise, values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>;
>filter : { <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1>[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; }
>       : ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                          ^^^              ^^^ ^^   ^^              ^^      ^^                     ^^        ^^                                                                          ^^^            ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                          ^^^              ^^^
>dit : typeof Promise
>    : ^^^^^^^^^^^^^^
>Promise : typeof Promise
>        : ^^^^^^^^^^^^^^
>values : Promise.Thenable<R>[]
>       : ^^^^^^^^^^^^^^^^^^^^^
>Promise : any
>        : ^^^
>filterer : (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>
>         : ^    ^^ ^^     ^^      ^^           ^^      ^^^^^
>item : R
>     : ^
>index : number
>      : ^^^^^^
>arrayLength : number
>            : ^^^^^^
>Promise : any
>        : ^^^

    static filter<R>(dit: typeof Promise, values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
>filter : { <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R_1>[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1[]>, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: Promise.Thenable<R_1>[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R_1[]>; <R_1>(dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise<R_1[]>; }
>       : ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                                         ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                          ^^^              ^^^^^^^^   ^^              ^^      ^^                       ^^        ^^                                                                            ^^^              ^^^ ^^   ^^              ^^      ^^                     ^^        ^^                                                        ^^^            ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                                            ^^^              ^^^^^^^^   ^^              ^^      ^^     ^^        ^^                                                          ^^^              ^^^
>dit : typeof Promise
>    : ^^^^^^^^^^^^^^
>Promise : typeof Promise
>        : ^^^^^^^^^^^^^^
>values : Promise.Thenable<R>[]
>       : ^^^^^^^^^^^^^^^^^^^^^
>Promise : any
>        : ^^^
>filterer : (item: R, index: number, arrayLength: number) => boolean
>         : ^    ^^ ^^     ^^      ^^           ^^      ^^^^^
>item : R
>     : ^
>index : number
>      : ^^^^^^
>arrayLength : number
>            : ^^^^^^


function f15a(o: Thing | undefined, value: unknown) {
    if (o?.foo === value) {
        o.foo;  // Error
    }
    else {
        o.foo;  // Error
    }
    if (o?.foo !== value) {
        o.foo;  // Error
    }
    else {
        o.foo;  // Error
    }
    if (o?.foo == value) {
        o.foo;  // Error
    }
    else {
        o.foo;  // Error
    }
    if (o?.foo != value) {
        o.foo;  // Error
    }
    else {
        o.foo;  // Error
    }
}

function f16(o: Thing | undefined) {
    if (o?.foo === undefined) {
        o.foo;  // Error
    }
    else {
        o.foo;
    }
    if (o?.foo !== undefined) {
        o.foo;
    }
    else {
        o.foo;  // Error
    }
    if (o?.foo == undefined) {
        o.foo;  // Error
    }
    else {
        o.foo;
    }
    if (o?.foo != undefined) {
        o.foo;
    }
    else {
        o.foo;  // Error
    }
}

function f20(o: Thing | undefined) {
    if (typeof o?.foo === "number") {
        o.foo;
    }
    if (typeof o?.["foo"] === "number") {
        o["foo"];
    }
    if (typeof o?.bar() === "number") {
        o.bar;
    }
    if (o?.baz instanceof Error) {
        o.baz;
    }
}

function f21(o: Thing | null) {
    if (typeof o?.foo === "number") {
        o.foo;
    }
    if (typeof o?.["foo"] === "number") {
        o["foo"];
    }
    if (typeof o?.bar() === "number") {
        o.bar;
    }
    if (o?.baz instanceof Error) {
        o.baz;
    }
}

function f22(o: Thing | undefined) {
    if (typeof o?.foo === "number") {
        o.foo;
    }
    else {
        o.foo;  // Error
    }
    if (typeof o?.foo !== "number") {
        o.foo;  // Error
    }
    else {
        o.foo;
    }
    if (typeof o?.foo == "number") {
        o.foo;
    }
    else {
        o.foo;  // Error
    }
    if (typeof o?.foo != "number") {
        o.foo;  // Error
    }
    else {
        o.foo;
    }
}

function f23(o: Thing | undefined) {
    if (typeof o?.foo === "undefined") {
        o.foo;  // Error
    }
    else {
        o.foo;
    }
    if (typeof o?.foo !== "undefined") {
        o.foo;
    }
    else {
        o.foo;  // Error
    }
    if (typeof o?.foo == "undefined") {
        o.foo;  // Error
    }
    else {
        o.foo;
    }
    if (typeof o?.foo != "undefined") {
        o.foo;
    }
    else {
        o.foo;  // Error
    }
}

declare function assert(x: unknown): asserts x;
declare function assertNonNull<T>(x: T): asserts x is NonNullable<T>;

function f30(o: Thing | undefined) {
    if (!!true) {
        assert(o?.foo);
        o.foo;
    }
    if (!!true) {
        assert(o?.foo === 42);
        o.foo;
    }
    if (!!true) {
        assert(typeof o?.foo === "number");
        o.foo;
    }
    if (!!true) {
        assertNonNull(o?.foo);
        o.foo;
    }
}

function f40(o: Thing | undefined) {
    switch (o?.foo) {
        case "abc":
            o.foo;
            break;
        case 42:
            o.foo;
            break;
        case undefined:
            o.foo;  // Error
            break;
        default:
            o.foo;  // Error
            break;
    }
}

function f41(o: Thing | undefined) {
    switch (typeof o?.foo) {
        case "string":
            o.foo;
            break;
        case "number":
            o.foo;
            break;
        case "undefined":
            o.foo;  // Error
            break;
        default:
            o.foo;  // Error
            break;
    }
}

// Repros from #34570

type Shape =
    | { type: 'rectangle', width: number, height: number }
    | { type: 'circle', radius: number }

function getArea(shape?: Shape) {
    switch (shape?.type) {
        case 'circle':
            return Math.PI * shape.radius ** 2
        case 'rectangle':
            return shape.width * shape.height
        default:
            return 0
    }
}

type Feature = {
  id: string;
  geometry?: {
    type: string;
    coordinates: number[];
  };
};

function extractCoordinates(f: Feature): number[] {
    if (f.geometry?.type !== 'test') {
        return [];
    }
    return f.geometry.coordinates;
}

// Repro from #35842

interface SomeObject {
    someProperty: unknown;
}

let lastSomeProperty: unknown | undefined;

function someFunction(someOptionalObject: SomeObject | undefined): void {
    if (someOptionalObject?.someProperty !== lastSomeProperty) {
        console.log(someOptionalObject);
        console.log(someOptionalObject.someProperty);  // Error
        lastSomeProperty = someOptionalObject?.someProperty;
    }
}

const someObject: SomeObject = {
    someProperty: 42
};

someFunction(someObject);
someFunction(undefined);

// Repro from #35970

let i = 0;
declare const arr: { tag: ("left" | "right") }[];

while (arr[i]?.tag === "left") {
    i += 1;
    if (arr[i]?.tag === "right") {
        console.log("I should ALSO be reachable");
    }
}

// Repro from #51941

type Test5 = {
  main?: {
    childs: Record<string, Test5>;
  };
};

function f50(obj: Test5) {
   for (const key in obj.main?.childs) {
      if (obj.main.childs[key] === obj) {
        return obj;
      }
   }
   return null;
}

//// [controlFlowOptionalChain.js]
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
var a;


privateFieldAssignabilityFromUnknown.ts(2,3): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
privateFieldAssignabilityFromUnknown.ts(5,7): error TS2741: Property '#field' is missing in type '{}' but required in type 'Class'.

==== privateFieldAssignabilityFromUnknown.ts (2 errors) ====
    export class Class {
      #field: any
      ~~~~~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
    }

    const task: Class = {} as unknown;
          ~~~~
!!! error TS2741: Property '#field' is missing in type '{}' but required in type 'Class'.
!!! related TS2728 privateFieldAssignabilityFromUnknown.ts:2:3: '#field' is declared here.


return Promise.resolve<TObj[K]>(obj[key]);
>Promise.resolve<TObj[K]>(obj[key]) : Promise<Awaited<TObj[K]>>
>                                   : ^^^^^^^^^^^^^^^^^^^^^^^^^
>Promise.resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>; }
>                : ^^^^^^             ^^^ ^^     ^^ ^^^                   ^^^ ^^     ^^                  ^^^                   ^^^
>Promise : PromiseConstructor
>        : ^^^^^^^^^^^^^^^^^^
>resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>; }
>        : ^^^^^^             ^^^ ^^     ^^ ^^^                   ^^^ ^^     ^^                  ^^^                   ^^^
>obj[key] : TObj[K]
>         : ^^^^^^^
>obj : TObj
>    : ^^^^
>key : K
>    : ^
}


metadataImportType.ts(2,6): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
metadataImportType.ts(3,15): error TS2307: Cannot find module './b' or its corresponding type declarations.

==== metadataImportType.ts (2 errors) ====
    export class A {
        @test
         ~~~~
!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.
        b: import('./b').B
                  ~~~~~
!!! error TS2307: Cannot find module './b' or its corresponding type declarations.
    }


a.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

==== tsconfig.json (0 errors) ====
    { "compilerOptions": {} }

==== a.ts (1 errors) ====
    module.exports = 1;
    ~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.


fixSignatureCaching.ts(9,10): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(284,10): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'.
fixSignatureCaching.ts(293,10): error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'.
fixSignatureCaching.ts(294,10): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'.
fixSignatureCaching.ts(295,10): error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'.
fixSignatureCaching.ts(301,17): error TS2339: Property 'isArray' does not exist on type 'never'.
fixSignatureCaching.ts(330,74): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(369,10): error TS2339: Property 'findMatch' does not exist on type '{}'.
fixSignatureCaching.ts(387,10): error TS2339: Property 'findMatches' does not exist on type '{}'.
fixSignatureCaching.ts(407,10): error TS2339: Property 'getVersionStr' does not exist on type '{}'.
fixSignatureCaching.ts(408,26): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(431,10): error TS2339: Property 'getVersion' does not exist on type '{}'.
fixSignatureCaching.ts(432,28): error TS2339: Property 'getVersionStr' does not exist on type '{}'.
fixSignatureCaching.ts(433,31): error TS2339: Property 'prepareVersionNo' does not exist on type '{}'.
fixSignatureCaching.ts(443,10): error TS2339: Property 'prepareVersionNo' does not exist on type '{}'.
fixSignatureCaching.ts(458,10): error TS2339: Property 'isMobileFallback' does not exist on type '{}'.
fixSignatureCaching.ts(459,21): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'.
fixSignatureCaching.ts(460,18): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'.
fixSignatureCaching.ts(463,10): error TS2339: Property 'isTabletFallback' does not exist on type '{}'.
fixSignatureCaching.ts(464,21): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'.
fixSignatureCaching.ts(467,10): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
fixSignatureCaching.ts(474,23): error TS2339: Property 'findMatch' does not exist on type '{}'.
fixSignatureCaching.ts(474,38): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(481,22): error TS2339: Property 'findMatch' does not exist on type '{}'.
fixSignatureCaching.ts(481,37): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(489,18): error TS2339: Property 'isMobileFallback' does not exist on type '{}'.
fixSignatureCaching.ts(492,37): error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'.
fixSignatureCaching.ts(495,51): error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'.
fixSignatureCaching.ts(498,52): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'.
fixSignatureCaching.ts(501,25): error TS2339: Property 'isTabletFallback' does not exist on type '{}'.
fixSignatureCaching.ts(502,48): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'.
fixSignatureCaching.ts(511,10): error TS2339: Property 'mobileGrade' does not exist on type '{}'.
fixSignatureCaching.ts(636,10): error TS2339: Property 'detectOS' does not exist on type '{}'.
fixSignatureCaching.ts(637,21): error TS2339: Property 'findMatch' does not exist on type '{}'.
fixSignatureCaching.ts(637,36): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(638,18): error TS2339: Property 'findMatch' does not exist on type '{}'.
fixSignatureCaching.ts(638,33): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(641,10): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'.
fixSignatureCaching.ts(707,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
fixSignatureCaching.ts(737,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
fixSignatureCaching.ts(786,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'.
fixSignatureCaching.ts(808,46): error TS2339: Property 'findMatch' does not exist on type '{}'.
fixSignatureCaching.ts(808,61): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(831,47): error TS2339: Property 'findMatches' does not exist on type '{}'.
fixSignatureCaching.ts(831,64): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(848,39): error TS2339: Property 'detectOS' does not exist on type '{}'.
fixSignatureCaching.ts(872,25): error TS2339: Property 'getVersion' does not exist on type '{}'.
fixSignatureCaching.ts(893,25): error TS2339: Property 'getVersionStr' does not exist on type '{}'.
fixSignatureCaching.ts(915,36): error TS2339: Property 'findMatches' does not exist on type '{}'.
fixSignatureCaching.ts(915,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
fixSignatureCaching.ts(955,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'.
fixSignatureCaching.ts(964,57): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'.
fixSignatureCaching.ts(978,16): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
fixSignatureCaching.ts(978,42): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
fixSignatureCaching.ts(979,37): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
fixSignatureCaching.ts(980,23): error TS2304: Cannot find name 'define'.
fixSignatureCaching.ts(980,48): error TS2304: Cannot find name 'define'.
fixSignatureCaching.ts(981,16): error TS2304: Cannot find name 'define'.
fixSignatureCaching.ts(983,44): error TS2339: Property 'MobileDetect' does not exist on type 'Window & typeof globalThis'.


var flat = _.reduceRight(list, (a, b) => a.concat(b), []);
>flat : number[]
>     : ^^^^^^^^
>_.reduceRight(list, (a, b) => a.concat(b), []) : number[]
>                                               : ^^^^^^^^
>_.reduceRight : { <T>(list: T[], iterator: Reducer<T, T>, initialValue?: T, context?: any): T; <T, U>(list: T[], iterator: Reducer<T, U>, initialValue: U, context?: any): U; <T>(list: Dictionary<T>, iterator: Reducer<T, T>, initialValue?: T, context?: any): T; <T, U>(list: Dictionary<T>, iterator: Reducer<T, U>, initialValue: U, context?: any): U; }
>              : ^^^ ^^    ^^   ^^        ^^             ^^            ^^^ ^^       ^^^   ^^^ ^^^ ^^ ^^    ^^   ^^        ^^             ^^            ^^ ^^       ^^^   ^^^ ^^^ ^^    ^^             ^^        ^^             ^^            ^^^ ^^       ^^^   ^^^ ^^^ ^^ ^^    ^^             ^^        ^^             ^^            ^^ ^^       ^^^   ^^^ ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>reduceRight : { <T>(list: T[], iterator: Reducer<T, T>, initialValue?: T, context?: any): T; <T, U>(list: T[], iterator: Reducer<T, U>, initialValue: U, context?: any): U; <T>(list: Dictionary<T>, iterator: Reducer<T, T>, initialValue?: T, context?: any): T; <T, U>(list: Dictionary<T>, iterator: Reducer<T, U>, initialValue: U, context?: any): U; }
>            : ^^^ ^^    ^^   ^^        ^^             ^^            ^^^ ^^       ^^^   ^^^ ^^^ ^^ ^^    ^^   ^^        ^^             ^^            ^^ ^^       ^^^   ^^^ ^^^ ^^    ^^             ^^        ^^             ^^            ^^^ ^^       ^^^   ^^^ ^^^ ^^ ^^    ^^             ^^        ^^             ^^            ^^ ^^       ^^^   ^^^ ^^^
>list : number[][]
>     : ^^^^^^^^^^
>(a, b) => a.concat(b) : (a: number[], b: number[]) => number[]
>                      : ^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
>a : number[]
>  : ^^^^^^^^
>b : number[]
>  : ^^^^^^^^
>a.concat(b) : number[]
>            : ^^^^^^^^
>a.concat : { (...items: ConcatArray<number>[]): number[]; (...items: (number | ConcatArray<number>)[]): number[]; }
>         : ^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>a : number[]
>  : ^^^^^^^^
>concat : { (...items: ConcatArray<number>[]): number[]; (...items: (number | ConcatArray<number>)[]): number[]; }
>       : ^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>b : number[]
>  : ^^^^^^^^
>[] : undefined[]
>   : ^^^^^^^^^^^

var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);
>even : number
>     : ^^^^^^
>_.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0) : number
>                                                  : ^^^^^^
>_.find : { <T>(list: T[], iterator: Iterator_<T, boolean>, context?: any): T; <T>(list: Dictionary<T>, iterator: Iterator_<T, boolean>, context?: any): T; }
>       : ^^^ ^^    ^^   ^^        ^^                     ^^       ^^^   ^^^ ^^^ ^^    ^^             ^^        ^^                     ^^       ^^^   ^^^ ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>find : { <T>(list: T[], iterator: Iterator_<T, boolean>, context?: any): T; <T>(list: Dictionary<T>, iterator: Iterator_<T, boolean>, context?: any): T; }
>     : ^^^ ^^    ^^   ^^        ^^                     ^^       ^^^   ^^^ ^^^ ^^    ^^             ^^        ^^                     ^^       ^^^   ^^^ ^^^
>[1, 2, 3, 4, 5, 6] : number[]
>                   : ^^^^^^^^
>1 : 1
>  : ^
>2 : 2
>  : ^
>3 : 3
>  : ^
>4 : 4
>  : ^
>5 : 5
>  : ^
>6 : 6
>  : ^
>(num) => num % 2 == 0 : (num: number) => boolean
>                      : ^   ^^^^^^^^^^^^^^^^^^^^
>num : number
>    : ^^^^^^
>num % 2 == 0 : boolean
>             : ^^^^^^^
>num % 2 : number
>        : ^^^^^^
>num : number
>    : ^^^^^^
>2 : 2
>  : ^
>0 : 0
>  : ^

var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);
>evens : number[]
>      : ^^^^^^^^
>_.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0) : number[]
>                                                    : ^^^^^^^^
>_.filter : { <T>(list: T[], iterator: Iterator_<T, boolean>, context?: any): T[]; <T>(list: Dictionary<T>, iterator: Iterator_<T, boolean>, context?: any): T[]; }
>         : ^^^ ^^    ^^   ^^        ^^                     ^^       ^^^   ^^^   ^^^ ^^    ^^             ^^        ^^                     ^^       ^^^   ^^^   ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>filter : { <T>(list: T[], iterator: Iterator_<T, boolean>, context?: any): T[]; <T>(list: Dictionary<T>, iterator: Iterator_<T, boolean>, context?: any): T[]; }
>       : ^^^ ^^    ^^   ^^        ^^                     ^^       ^^^   ^^^   ^^^ ^^    ^^             ^^        ^^                     ^^       ^^^   ^^^   ^^^
>[1, 2, 3, 4, 5, 6] : number[]
>                   : ^^^^^^^^
>1 : 1
>  : ^
>2 : 2
>  : ^
>3 : 3
>  : ^
>4 : 4
>  : ^
>5 : 5
>  : ^
>6 : 6
>  : ^
>(num) => num % 2 == 0 : (num: number) => boolean
>                      : ^   ^^^^^^^^^^^^^^^^^^^^
>num : number
>    : ^^^^^^
>num % 2 == 0 : boolean
>             : ^^^^^^^
>num % 2 : number
>        : ^^^^^^
>num : number
>    : ^^^^^^
>2 : 2
>  : ^
>0 : 0
>  : ^


_.any([null, 0, 'yes', false]);
>_.any([null, 0, 'yes', false]) : boolean
>                               : ^^^^^^^
>_.any : { <T>(list: T[], iterator?: Iterator_<T, boolean>, context?: any): boolean; <T>(list: Dictionary<T>, iterator?: Iterator_<T, boolean>, context?: any): boolean; }
>      : ^^^ ^^    ^^   ^^        ^^^                     ^^       ^^^   ^^^       ^^^ ^^    ^^             ^^        ^^^                     ^^       ^^^   ^^^       ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>any : { <T>(list: T[], iterator?: Iterator_<T, boolean>, context?: any): boolean; <T>(list: Dictionary<T>, iterator?: Iterator_<T, boolean>, context?: any): boolean; }
>    : ^^^ ^^    ^^   ^^        ^^^                     ^^       ^^^   ^^^       ^^^ ^^    ^^             ^^        ^^^                     ^^       ^^^   ^^^       ^^^
>[null, 0, 'yes', false] : (string | number | false)[]
>                        : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>0 : 0
>  : ^
>'yes' : "yes"
>      : ^^^^^
>false : false
>      : ^^^^^

_.contains([1, 2, 3], 3);
>_.contains([1, 2, 3], 3) : boolean
>                         : ^^^^^^^
>_.contains : { <T>(list: T[], value: T): boolean; <T>(list: Dictionary<T>, value: T): boolean; }
>           : ^^^ ^^    ^^   ^^     ^^ ^^^       ^^^ ^^    ^^             ^^     ^^ ^^^       ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>contains : { <T>(list: T[], value: T): boolean; <T>(list: Dictionary<T>, value: T): boolean; }
>         : ^^^ ^^    ^^   ^^     ^^ ^^^       ^^^ ^^    ^^             ^^     ^^ ^^^       ^^^
>[1, 2, 3] : number[]
>          : ^^^^^^^^
>1 : 1
>  : ^
>2 : 2
>  : ^
>3 : 3
>  : ^
>3 : 3
>  : ^

_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
>_.invoke([[5, 1, 7], [3, 2, 1]], 'sort') : any[]
>                                         : ^^^^^
>_.invoke : { (list: any[], methodName: string, ...args: any[]): any[]; (list: Dictionary<any>, methodName: string, ...args: any[]): any[]; }
>         : ^^^    ^^     ^^          ^^      ^^^^^    ^^     ^^^     ^^^    ^^               ^^          ^^      ^^^^^    ^^     ^^^     ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>invoke : { (list: any[], methodName: string, ...args: any[]): any[]; (list: Dictionary<any>, methodName: string, ...args: any[]): any[]; }
>       : ^^^    ^^     ^^          ^^      ^^^^^    ^^     ^^^     ^^^    ^^               ^^          ^^      ^^^^^    ^^     ^^^     ^^^
>[[5, 1, 7], [3, 2, 1]] : number[][]
>                       : ^^^^^^^^^^
>[5, 1, 7] : number[]
>          : ^^^^^^^^
>5 : 5
>  : ^
>1 : 1
>  : ^
>7 : 7
>  : ^
>[3, 2, 1] : number[]
>          : ^^^^^^^^
>3 : 3
>  : ^
>2 : 2
>  : ^
>1 : 1
>  : ^
>'sort' : "sort"
>       : ^^^^^^

var stooges = [{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }];
>stooges : { name: string; age: number; }[]
>        : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>[{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }] : { name: string; age: number; }[]
>                                                                                : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>{ name: 'moe', age: 40 } : { name: string; age: number; }
>                         : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>name : string
>     : ^^^^^^
>'moe' : "moe"
>      : ^^^^^
>age : number
>    : ^^^^^^
>40 : 40
>   : ^^
>{ name: 'larry', age: 50 } : { name: string; age: number; }
>                           : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>name : string
>     : ^^^^^^
>'larry' : "larry"
>        : ^^^^^^^
>age : number
>    : ^^^^^^
>50 : 50
>   : ^^
>{ name: 'curly', age: 60 } : { name: string; age: number; }
>                           : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>name : string
>     : ^^^^^^
>'curly' : "curly"
>        : ^^^^^^^
>age : number
>    : ^^^^^^
>60 : 60
>   : ^^

_.pluck(stooges, 'name');
>_.pluck(stooges, 'name') : any[]
>                         : ^^^^^
>_.pluck : { (list: any[], propertyName: string): any[]; (list: Dictionary<any>, propertyName: string): any[]; }
>        : ^^^    ^^     ^^            ^^      ^^^     ^^^    ^^               ^^            ^^      ^^^     ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>pluck : { (list: any[], propertyName: string): any[]; (list: Dictionary<any>, propertyName: string): any[]; }
>      : ^^^    ^^     ^^            ^^      ^^^     ^^^    ^^               ^^            ^^      ^^^     ^^^
>stooges : { name: string; age: number; }[]
>        : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>'name' : "name"
>       : ^^^^^^

_.max(stooges, (stooge) => stooge.age);
>_.max(stooges, (stooge) => stooge.age) : { name: string; age: number; }
>                                       : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>_.max : { <T>(list: T[], iterator?: Iterator_<T, any>, context?: any): T; <T>(list: Dictionary<T>, iterator?: Iterator_<T, any>, context?: any): T; }
>      : ^^^ ^^    ^^   ^^        ^^^                 ^^       ^^^   ^^^ ^^^ ^^    ^^             ^^        ^^^                 ^^       ^^^   ^^^ ^^^
>_ : Underscore.Static
>  : ^^^^^^^^^^^^^^^^^
>max : { <T>(list: T[], iterator?: Iterator_<T, any>, context?: any): T; <T>(list: Dictionary<T>, iterator?: Iterator_<T, any>, context?: any): T; }
>    : ^^^ ^^    ^^   ^^        ^^^                 ^^       ^^^   ^^^ ^^^ ^^    ^^             ^^        ^^^                 ^^       ^^^   ^^^ ^^^
>stooges : { name: string; age: number; }[]
>        : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>(stooge) => stooge.age : (stooge: { name: string; age: number; }) => number
>                       : ^      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>stooge : { name: string; age: number; }
>       : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>stooge.age : number
>           : ^^^^^^
>stooge : { name: string; age: number; }
>       : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>age : number
>    : ^^^^^^


a.ts(1,14): error TS2868: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig.

==== tsconfig.json (0 errors) ====
    { "compilerOptions": {"types": []} }

==== a.ts (1 errors) ====
    const file = Bun.file("/a.ts");
                 ~~~
!!! error TS2868: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig.


parser509693.ts(1,6): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
parser509693.ts(1,22): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

==== parser509693.ts (2 errors) ====
    if (!module.exports) module.exports = "";
         ~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
                         ~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.


// ==ORIGINAL==

type APIResponse<T> = { success: true, data: T } | { success: false };

function wrapResponse<T>(response: T): APIResponse<T> {
    return { success: true, data: response };
}

function /*[#|*/get/*|]*/() {
    return Promise.resolve(undefined!).then<APIResponse<{ email: string }>>(d => {
        console.log(d);
        return wrapResponse(d);
    });
}

// ==ASYNC FUNCTION::Convert to async function==

type APIResponse<T> = { success: true, data: T } | { success: false };

function wrapResponse<T>(response: T): APIResponse<T> {
    return { success: true, data: response };
}

async function get() {
    const d = await Promise.resolve(undefined!);
    console.log(d);
    const result: APIResponse<{ email: string; }> = wrapResponse(d);
    return result;
}


// ==ORIGINAL==

function /*[#|*/f/*|]*/(): Promise<void>{
    const result = getResult();
    return fetch('https://typescriptlang.org').then(({ result }) => { console.log(result) });
}
// ==ASYNC FUNCTION::Convert to async function==

async function f(): Promise<void>{
    const result = getResult();
    const { result: result_1 } = await fetch('https://typescriptlang.org');
    console.log(result_1);
}


// ==ORIGINAL==

type APIResponse<T> = { success: true, data: T } | { success: false };

function wrapResponse<T>(response: T): APIResponse<T> {
    return { success: true, data: response };
}

function /*[#|*/get/*|]*/() {
    return Promise.resolve(undefined!).then<APIResponse<{ email: string }>>(d => wrapResponse(d));
}

// ==ASYNC FUNCTION::Convert to async function==

type APIResponse<T> = { success: true, data: T } | { success: false };

function wrapResponse<T>(response: T): APIResponse<T> {
    return { success: true, data: response };
}

async function get() {
    const d = await Promise.resolve(undefined!);
    const result: APIResponse<{ email: string; }> = wrapResponse(d);
    return result;
}