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

Compile errors in the editor #16819

Closed
jrieken opened this issue Dec 7, 2016 · 7 comments
Closed

Compile errors in the editor #16819

jrieken opened this issue Dec 7, 2016 · 7 comments
Assignees
Labels
important Issue identified as high-priority typescript Typescript support issues

Comments

@jrieken
Copy link
Member

jrieken commented Dec 7, 2016

Since today (Insiders-1.8.0 0d65ced) I see compile errors in the editor that don't show up when running gulp watch. Unsure if this is new TypeScript behaviour or bugs? Samples are

@jrieken jrieken added important Issue identified as high-priority typescript Typescript support issues labels Dec 7, 2016
@kieferrm
Copy link
Member

kieferrm commented Dec 7, 2016

This is the condensed version of snippetParser.ts that still creates the problem:

export abstract class Marker {
	static toString(markers: Marker[]): string {
		return '';
	}
}

export class Placeholder extends Marker {
	constructor(public name: string = '', public defaultValue: Marker[]) {
		super();
	}
}

function foo(marker: Marker) {
	if (marker instanceof Placeholder) {
		console.log(marker.name);
		console.log(marker.defaultValue);
	}
}

foo(null);

@kieferrm
Copy link
Member

kieferrm commented Dec 7, 2016

This is the error we are getting:
screen shot 2016-12-07 at 8 55 21 am

@jrieken
Copy link
Member Author

jrieken commented Dec 7, 2016

Thanks for drilling into this. I might push a change to rename my method...

@kieferrm
Copy link
Member

kieferrm commented Dec 7, 2016

Here is the second one:

export interface Foo {
	property: boolean;
	[key: string]: any;
}

function freezer(bar: Foo): Foo {
	return Object.freeze(bar);
}

freezer(null);

The issue is caused when an index is combined with anything else no matter if a property or method.

The error we get is:
screen shot 2016-12-07 at 9 36 11 am

@mjbvz
Copy link
Contributor

mjbvz commented Dec 7, 2016

Opened two more issues against TS to track other issue we are seeing when compiling VSCode with 2.1.4:

I'm going to submit quick workarounds fixes to our code for those two problems. They just require additional casts

@mjbvz
Copy link
Contributor

mjbvz commented Dec 7, 2016

Fixed those two errors with #16861

@mjbvz
Copy link
Contributor

mjbvz commented Dec 19, 2016

I believe this was resolved by #16861 and 499a648.

We also followed up with the TS team. Most of the errors are by design and are breaking changes in TS 2.1

@mjbvz mjbvz closed this as completed Dec 19, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
important Issue identified as high-priority typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

3 participants