Set '.declarations' on a property of a homomorphic mapped type

This commit is contained in:
Andy Hanson
2017-05-24 08:14:52 -07:00
parent b4ee6b19aa
commit b0de80f07e
2 changed files with 31 additions and 0 deletions

View File

@@ -5690,6 +5690,7 @@ namespace ts {
prop.type = propType;
if (propertySymbol) {
prop.syntheticOrigin = propertySymbol;
prop.declarations = propertySymbol.declarations;
}
members.set(propName, prop);
}

View File

@@ -0,0 +1,30 @@
/// <reference path="../fourslash.ts"/>
////interface Foo {
//// /** Doc */
//// bar: number;
////}
////
////const f: Foo = { bar: 0 };
////f./*f*/bar;
////
////const f2: { [TKey in keyof Foo]: string } = { bar: "0" };
////f2./*f2*/bar;
////
////const f3 = { ...f };
////f3./*f3*/bar;
////
////const f4 = { ...f2 };
////f4./*f4*/bar;
goTo.marker("f");
verify.quickInfoIs("(property) Foo.bar: number", "Doc ");
goTo.marker("f2");
verify.quickInfoIs("(property) bar: string", "Doc ");
goTo.marker("f3");
verify.quickInfoIs("(property) Foo.bar: number", "Doc ");
goTo.marker("f4");
verify.quickInfoIs("(property) bar: string", "Doc ");