@@ -752,3 +752,35 @@ let fooAsyncGenM: FooAsyncGenMethod = {
752
752
}
753
753
};
754
754
755
+ // Repro from #48345
756
+
757
+ type Func = <T extends ["a", number] | ["b", string]>(...args: T) => void;
758
+ >Func : Symbol(Func, Decl(dependentDestructuredVariables.ts, 295, 2))
759
+ >T : Symbol(T, Decl(dependentDestructuredVariables.ts, 299, 13))
760
+ >args : Symbol(args, Decl(dependentDestructuredVariables.ts, 299, 54))
761
+ >T : Symbol(T, Decl(dependentDestructuredVariables.ts, 299, 13))
762
+
763
+ const f60: Func = (kind, payload) => {
764
+ >f60 : Symbol(f60, Decl(dependentDestructuredVariables.ts, 301, 5))
765
+ >Func : Symbol(Func, Decl(dependentDestructuredVariables.ts, 295, 2))
766
+ >kind : Symbol(kind, Decl(dependentDestructuredVariables.ts, 301, 19))
767
+ >payload : Symbol(payload, Decl(dependentDestructuredVariables.ts, 301, 24))
768
+
769
+ if (kind === "a") {
770
+ >kind : Symbol(kind, Decl(dependentDestructuredVariables.ts, 301, 19))
771
+
772
+ payload.toFixed(); // error
773
+ >payload.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
774
+ >payload : Symbol(payload, Decl(dependentDestructuredVariables.ts, 301, 24))
775
+ >toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --))
776
+ }
777
+ if (kind === "b") {
778
+ >kind : Symbol(kind, Decl(dependentDestructuredVariables.ts, 301, 19))
779
+
780
+ payload.toUpperCase(); // error
781
+ >payload.toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
782
+ >payload : Symbol(payload, Decl(dependentDestructuredVariables.ts, 301, 24))
783
+ >toUpperCase : Symbol(String.toUpperCase, Decl(lib.es5.d.ts, --, --))
784
+ }
785
+ };
786
+
0 commit comments