mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-25 22:01:51 -05:00
Set '.declarations' on a property of a homomorphic mapped type
This commit is contained in:
@@ -5690,6 +5690,7 @@ namespace ts {
|
||||
prop.type = propType;
|
||||
if (propertySymbol) {
|
||||
prop.syntheticOrigin = propertySymbol;
|
||||
prop.declarations = propertySymbol.declarations;
|
||||
}
|
||||
members.set(propName, prop);
|
||||
}
|
||||
|
||||
30
tests/cases/fourslash/server/quickInfoMappedSpreadTypes.ts
Normal file
30
tests/cases/fourslash/server/quickInfoMappedSpreadTypes.ts
Normal 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 ");
|
||||
Reference in New Issue
Block a user