Repository: TypeScript
Issue: should not throw error at `.d.ts` when `func` + `namespace` has member `default`
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.4.0-dev.201xxxxx

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Code**

.d.ts
```ts
declare function execAll<T extends RegExp = RegExp>(inputRegExp: T | RegExp, input: string, options?: IExecAllOptions<T>): IMatches<T>;
declare namespace execAll {
    var default: typeof execAll;
}
import IExecAllOptions = execAll.IExecAllOptions;
import IMatches = execAll.IMatches;
declare namespace execAll {
    function execall<T extends RegExp = RegExp>(inputRegExp: T | RegExp, input: string, options?: IExecAllOptions<T>): IMatches<T>;
    interface IExecAllOptions<T extends RegExp = RegExp> {
        resetLastIndex?: boolean;
        /**
         * allow change cloneRegexp function
         */
        cloneRegexp?: ICloneRegexp<T>;
        /**
         * only use this when u know what u doing
         */
        leftContext?: boolean;
        rightContext?: boolean;
        removeHiddenData?: boolean;
    }
    interface ICloneRegexp<T extends RegExp = RegExp> {
        (inputRegExp: T | RegExp, ...argv: any[]): T;
    }
    type IExecAllRegExpExecArray<T extends RegExp = RegExp> = RegExpExecArray & string[] & {
        /**
         * The 0-based index of the match in the string.
         */
        index: number;
        /**
         * es2018
         */
        groups?: {
            [k: string]: string;
        };
    };
    type IMatches<T extends RegExp = RegExp> = (IExecAllRegExpExecArray<T> & {
        match: string;
        sub: string[];
        leftContext?: string;
        rightContext?: string;
    })[] & {
        /**
         * regular expressions
         *
         * @readonly
         */
        readonly re: T;
        /**
         * regular expressions that contains the string against which a regular expression is matched.
         *
         * @readonly
         */
        readonly input: string;
        /**
         * last matched index
         *
         * @readonly
         */
        readonly lastIndex: number;
    };
    const SYMBOL: unique symbol;
}
export = execAll;

```

**Expected behavior:**

> no error

**Actual behavior:**

![image](https://user-images.githubusercontent.com/167966/61464421-cd91e000-a9a8-11e9-8ec6-c00623d18f43.png)


```
Error:(3, 9) TS1134: Variable declaration expected.
Error:(3, 16) TS1134: Variable declaration expected.
Error:(3, 18) TS1134: Variable declaration expected.
```

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

**Related Issues:** <!-- Did you find other bugs that looked similar? -->