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 use JSDoc all the way in type inference #6659

Closed
egamma opened this issue Jan 27, 2016 · 0 comments
Closed

Salsa does not use JSDoc all the way in type inference #6659

egamma opened this issue Jan 27, 2016 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@egamma
Copy link
Member

egamma commented Jan 27, 2016

From @alexandrudima on January 27, 2016 12:40

Testing #2218

I would expect Person and Person2 to behave the same given the JSDoc "types" age to be a number.

/**
 * @param {number} age
 */
function Person(age) {
    this.age = age; // <- it knows age is a number
}

function Person2() {
    this.age = 13;
}

var p1 = new Person();
var p2 = new Person2();

var a = p1.age; // <- it doesn't know this is a number
var b = p2.age; // <- it knows this is a number

Copied from original issue: microsoft/vscode#2437

@egamma egamma self-assigned this Jan 27, 2016
@billti billti added the Salsa label Jan 27, 2016
@billti billti added this to the Salsa 0.9 milestone Jan 27, 2016
@billti billti assigned RyanCavanaugh and unassigned egamma Jan 27, 2016
@billti billti added the Bug A bug in TypeScript label Jan 27, 2016
RyanCavanaugh added a commit to RyanCavanaugh/TypeScript that referenced this issue Jan 27, 2016
@RyanCavanaugh RyanCavanaugh added the Fixed A PR has been merged for this issue label Jan 28, 2016
@mhegazy mhegazy modified the milestones: Salsa 0.9, TypeScript 1.8.2 Feb 2, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants