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

Salsa does not warn or help when passing in wrong argument type #2442

Closed
alexdima opened this issue Jan 27, 2016 · 3 comments
Closed

Salsa does not warn or help when passing in wrong argument type #2442

alexdima opened this issue Jan 27, 2016 · 3 comments
Assignees

Comments

@alexdima
Copy link
Member

Testing #2218

/**
 * @param {string} name
 */
function howdy(name) {

}

howdy(3);

image

even if it knows a string is expected:

image

@billti
Copy link
Member

billti commented Jan 27, 2016

Correct. We explicitly decided to give no warnings/errors other than syntax errors for JavaScript code. If warnings on incorrect type usage are required, we'd need to spec how and when these would occur in JavaScript, else being based on TypeScript, code such as the below would also be a type error:

var x = 10;
x = "ten";

var y = {a:true};
y.b = false;

@egamma
Copy link
Member

egamma commented Jan 27, 2016

In the existing Code JS language service we gave warnings for the first example above and we didn't receive complaints.

errors

We have also warned about undefined variables, which had issues when users where also using a linter in their project and they defined a global as a global in their linter configuration. The confusion was that they define the global in linter configuration, but our JS service still warned about the global.

@egamma
Copy link
Member

egamma commented Jan 27, 2016

This issue was moved to microsoft/TypeScript#6658

@egamma egamma closed this as completed Jan 27, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants