/a/app.ts(3,5): error TS2322: Type 'undefined' is not assignable to type 'Error'.


==== /a/node_modules/@types/node/index.d.ts (0 errors) ====
    interface Error {
        stack2: string;
    }
    
==== /a/app.ts (1 errors) ====
    /// <reference types="node"/>
    function foo(): Error {
        return undefined;
        ~~~~~~
!!! error TS2322: Type 'undefined' is not assignable to type 'Error'.
    }