Port #9621 to release-2.0
This commit is contained in:
parent
fa0fab1523
commit
606ac0e533
2 changed files with 32 additions and 5 deletions
|
@ -3160,6 +3160,9 @@ namespace ts {
|
|||
if (declaration.kind === SyntaxKind.ExportAssignment) {
|
||||
return links.type = checkExpression((<ExportAssignment>declaration).expression);
|
||||
}
|
||||
if (declaration.flags & NodeFlags.JavaScriptFile && declaration.kind === SyntaxKind.JSDocPropertyTag && (<JSDocPropertyTag>declaration).typeExpression) {
|
||||
return links.type = getTypeFromTypeNode((<JSDocPropertyTag>declaration).typeExpression.type);
|
||||
}
|
||||
// Handle variable, parameter or property
|
||||
if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) {
|
||||
return unknownType;
|
||||
|
|
|
@ -32,16 +32,24 @@
|
|||
//// var numberLike; numberLike./*numberLike*/
|
||||
////
|
||||
//// /** @type {Person} */
|
||||
//// var p;p./*person*/
|
||||
//// var p;p./*person*/;
|
||||
//// p.personName./*personName*/;
|
||||
//// p.personAge./*personAge*/;
|
||||
////
|
||||
//// /** @type {Animal} */
|
||||
//// var a;a./*animal*/
|
||||
//// var a;a./*animal*/;
|
||||
//// a.animalName./*animalName*/;
|
||||
//// a.animalAge./*animalAge*/;
|
||||
////
|
||||
//// /** @type {Cat} */
|
||||
//// var c;c./*cat*/
|
||||
//// var c;c./*cat*/;
|
||||
//// c.catName./*catName*/;
|
||||
//// c.catAge./*catAge*/;
|
||||
////
|
||||
//// /** @type {Dog} */
|
||||
//// var d;d./*dog*/
|
||||
//// var d;d./*dog*/;
|
||||
//// d.dogName./*dogName*/;
|
||||
//// d.dogAge./*dogAge*/;
|
||||
|
||||
goTo.marker('numberLike');
|
||||
verify.memberListContains('charAt');
|
||||
|
@ -50,15 +58,31 @@ verify.memberListContains('toExponential');
|
|||
goTo.marker('person');
|
||||
verify.memberListContains('personName');
|
||||
verify.memberListContains('personAge');
|
||||
goTo.marker('personName');
|
||||
verify.memberListContains('charAt');
|
||||
goTo.marker('personAge');
|
||||
verify.memberListContains('toExponential');
|
||||
|
||||
goTo.marker('animal');
|
||||
verify.memberListContains('animalName');
|
||||
verify.memberListContains('animalAge');
|
||||
goTo.marker('animalName');
|
||||
verify.memberListContains('charAt');
|
||||
goTo.marker('animalAge');
|
||||
verify.memberListContains('toExponential');
|
||||
|
||||
goTo.marker('dog');
|
||||
verify.memberListContains('dogName');
|
||||
verify.memberListContains('dogAge');
|
||||
goTo.marker('dogName');
|
||||
verify.memberListContains('charAt');
|
||||
goTo.marker('dogAge');
|
||||
verify.memberListContains('toExponential');
|
||||
|
||||
goTo.marker('cat');
|
||||
verify.memberListContains('catName');
|
||||
verify.memberListContains('catAge');
|
||||
goTo.marker('catName');
|
||||
verify.memberListContains('charAt');
|
||||
goTo.marker('catAge');
|
||||
verify.memberListContains('toExponential');
|
Loading…
Reference in a new issue