Open sw6ueyz opened 1 year ago
I agree this is a bug. When comparing the overload implementation to the overload list, we shouldn't be taking method bivariance into account.
Odds seem pretty high that this is going to cause a huge amount of unnecessary breaks and we'll end up rejecting the fix 🫠
🔎 Search Terms
implementation contain overloaded class member
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.2.2#code/FAYwNghgzlAEDCwDexZtgMwPZYBSwgH5YAuWAOwFcBbAIwFMAnWASlNgDcsBLAEwG5U6bHgLsqdJgBpYtcTQbM2ZLn0HpMOfBHmTGM2sTITFrdqt5C0KDRpBZyULGHoA6MFgDm+AC4BPAAd6LAwxFn5YAHpI2H8gkLFuOBMmK1gAX2BM4HJ6AHcEXBZXESKIqJiAxm5yHzgAIkpyXnoMGvpeeuAgA
💻 Code
🙁 Actual behavior
The compilation succeeded.
The type of argument "a" in function foo is number but prints "undefined" which is wrong.
Because the implementation signature of foo does not include all overload signatures, so compilation should fail.
🙂 Expected behavior
The compilation should fail.
Additional information about the issue
This bug is only reproduced with class member functions.