@@ -965,3 +965,29 @@ const fa3: (...args: [true, number] | [false, string]) => void = (guard, value)
965
965
}
966
966
}
967
967
968
+ // repros from #47190#issuecomment-1339753554
969
+ const f70: (...args: [type: "one"] | [type: "two", x: string]) => void = (type, x) => {
970
+ >f70 : Symbol(f70, Decl(dependentDestructuredVariables.ts, 389, 5))
971
+ >args : Symbol(args, Decl(dependentDestructuredVariables.ts, 389, 12))
972
+ >type : Symbol(type, Decl(dependentDestructuredVariables.ts, 389, 74))
973
+ >x : Symbol(x, Decl(dependentDestructuredVariables.ts, 389, 79))
974
+
975
+ if (type !== "one") x.toUpperCase();
976
+ >type : Symbol(type, Decl(dependentDestructuredVariables.ts, 389, 74))
977
+ >x.toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
978
+ >x : Symbol(x, Decl(dependentDestructuredVariables.ts, 389, 79))
979
+ >toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
980
+ }
981
+ const f71: (...args: [type: "one", x?: number] | [type: "two", x: string]) => void = (type, x) => {
982
+ >f71 : Symbol(f71, Decl(dependentDestructuredVariables.ts, 392, 5))
983
+ >args : Symbol(args, Decl(dependentDestructuredVariables.ts, 392, 12))
984
+ >type : Symbol(type, Decl(dependentDestructuredVariables.ts, 392, 86))
985
+ >x : Symbol(x, Decl(dependentDestructuredVariables.ts, 392, 91))
986
+
987
+ if (type !== "one") x.toUpperCase();
988
+ >type : Symbol(type, Decl(dependentDestructuredVariables.ts, 392, 86))
989
+ >x.toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
990
+ >x : Symbol(x, Decl(dependentDestructuredVariables.ts, 392, 91))
991
+ >toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
992
+ }
993
+
0 commit comments