Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespaced ES6 classes are not recognized as types #31172

Open
zeule opened this issue Apr 30, 2019 · 0 comments
Open

Namespaced ES6 classes are not recognized as types #31172

zeule opened this issue Apr 30, 2019 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@zeule
Copy link

zeule commented Apr 30, 2019

  • VSCode Version: 1.33.1
  • OS Version: Linux x64

MWE:
jsconfig.json

{
    "compilerOptions": {
        "target": "es2018",
        "checkJs": true
    },
    "files": [
        "mwe.js",
        "mwe.d.ts"
    ]
}

mwe.js:

class T {
	constructor() {
		this.x = 1.23;
	}
}

var NS = {}

NS.T = class {
	constructor() {
		this.x = 1.23;
	}
}

mwe.d.ts:

function f1(x: T): void;
function f2(x: NS.T): void;

The problem: the type of parameter for f2 is shown as any and no type checking is done.

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz transferred this issue from microsoft/vscode Apr 30, 2019
@mjbvz mjbvz removed their assignment Apr 30, 2019
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Apr 30, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants