@@ -928,3 +928,89 @@ const getStringAndNumberFromOriginalAndMapped = <
928928>nestedKey : Symbol(nestedKey, Decl(correlatedUnions.ts, 265, 9))
929929
930930};
931+
932+ // repro from #31675
933+ interface Config {
934+ >Config : Symbol(Config, Decl(correlatedUnions.ts, 269, 2))
935+
936+ string: string;
937+ >string : Symbol(Config.string, Decl(correlatedUnions.ts, 272, 18))
938+
939+ number: number;
940+ >number : Symbol(Config.number, Decl(correlatedUnions.ts, 273, 17))
941+ }
942+
943+ function getConfigOrDefault<T extends keyof Config>(
944+ >getConfigOrDefault : Symbol(getConfigOrDefault, Decl(correlatedUnions.ts, 275, 1))
945+ >T : Symbol(T, Decl(correlatedUnions.ts, 277, 28))
946+ >Config : Symbol(Config, Decl(correlatedUnions.ts, 269, 2))
947+
948+ userConfig: Partial<Config>,
949+ >userConfig : Symbol(userConfig, Decl(correlatedUnions.ts, 277, 52))
950+ >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
951+ >Config : Symbol(Config, Decl(correlatedUnions.ts, 269, 2))
952+
953+ key: T,
954+ >key : Symbol(key, Decl(correlatedUnions.ts, 278, 30))
955+ >T : Symbol(T, Decl(correlatedUnions.ts, 277, 28))
956+
957+ defaultValue: Config[T]
958+ >defaultValue : Symbol(defaultValue, Decl(correlatedUnions.ts, 279, 9))
959+ >Config : Symbol(Config, Decl(correlatedUnions.ts, 269, 2))
960+ >T : Symbol(T, Decl(correlatedUnions.ts, 277, 28))
961+
962+ ): Config[T] {
963+ >Config : Symbol(Config, Decl(correlatedUnions.ts, 269, 2))
964+ >T : Symbol(T, Decl(correlatedUnions.ts, 277, 28))
965+
966+ const userValue = userConfig[key];
967+ >userValue : Symbol(userValue, Decl(correlatedUnions.ts, 282, 7))
968+ >userConfig : Symbol(userConfig, Decl(correlatedUnions.ts, 277, 52))
969+ >key : Symbol(key, Decl(correlatedUnions.ts, 278, 30))
970+
971+ const assertedCheck = userValue ? userValue! : defaultValue;
972+ >assertedCheck : Symbol(assertedCheck, Decl(correlatedUnions.ts, 283, 7))
973+ >userValue : Symbol(userValue, Decl(correlatedUnions.ts, 282, 7))
974+ >userValue : Symbol(userValue, Decl(correlatedUnions.ts, 282, 7))
975+ >defaultValue : Symbol(defaultValue, Decl(correlatedUnions.ts, 279, 9))
976+
977+ return assertedCheck;
978+ >assertedCheck : Symbol(assertedCheck, Decl(correlatedUnions.ts, 283, 7))
979+ }
980+
981+ // repro from #47523
982+
983+ type Foo1 = {
984+ >Foo1 : Symbol(Foo1, Decl(correlatedUnions.ts, 285, 1))
985+
986+ x: number;
987+ >x : Symbol(x, Decl(correlatedUnions.ts, 289, 13))
988+
989+ y: string;
990+ >y : Symbol(y, Decl(correlatedUnions.ts, 290, 12))
991+
992+ };
993+
994+ function getValueConcrete<K extends keyof Foo1>(
995+ >getValueConcrete : Symbol(getValueConcrete, Decl(correlatedUnions.ts, 292, 2))
996+ >K : Symbol(K, Decl(correlatedUnions.ts, 294, 26))
997+ >Foo1 : Symbol(Foo1, Decl(correlatedUnions.ts, 285, 1))
998+
999+ o: Partial<Foo1>,
1000+ >o : Symbol(o, Decl(correlatedUnions.ts, 294, 48))
1001+ >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
1002+ >Foo1 : Symbol(Foo1, Decl(correlatedUnions.ts, 285, 1))
1003+
1004+ k: K
1005+ >k : Symbol(k, Decl(correlatedUnions.ts, 295, 19))
1006+ >K : Symbol(K, Decl(correlatedUnions.ts, 294, 26))
1007+
1008+ ): Foo1[K] | undefined {
1009+ >Foo1 : Symbol(Foo1, Decl(correlatedUnions.ts, 285, 1))
1010+ >K : Symbol(K, Decl(correlatedUnions.ts, 294, 26))
1011+
1012+ return o[k];
1013+ >o : Symbol(o, Decl(correlatedUnions.ts, 294, 48))
1014+ >k : Symbol(k, Decl(correlatedUnions.ts, 295, 19))
1015+ }
1016+
0 commit comments