[3.2.0-rc] .bind with overloads causes compile error in strict mode (strictBindCallApply) #28582
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
Fixed
A PR has been merged for this issue
TypeScript Version: 3.2.0-rc
Search Terms:
strictBindCallApply, bind, overload
Code
Expected behavior:
Not exactly sure, but not an error
Actual behavior:
Error -- see playground link
Playground Link:
http://www.typescriptlang.org/play/index.html#src=class%20Logger%20%7B%0D%0A%20%20static%20debug(message%3A%20string%2C%20...params%3A%20any%5B%5D)%3A%20void%3B%0D%0A%20%20static%20debug(context%3A%20object%20%7C%20undefined%2C%20message%3A%20string%2C%20...params%3A%20any%5B%5D)%3A%20void%3B%0D%0A%20%20static%20debug(contextOrMessage%3A%20object%20%7C%20string%20%7C%20undefined%2C%20...params%3A%20any%5B%5D)%3A%20void%20%7B%0D%0A%20%20%20%20%2F%2F%20...%0D%0A%20%20%7D%0D%0A%0D%0A%20%20static%20log(message%3A%20string%2C%20...params%3A%20any%5B%5D)%3A%20void%3B%0D%0A%20%20static%20log(context%3A%20object%20%7C%20undefined%2C%20message%3A%20string%2C%20...params%3A%20any%5B%5D)%3A%20void%3B%0D%0A%20%20static%20log(contextOrMessage%3A%20object%20%7C%20string%20%7C%20undefined%2C%20...params%3A%20any%5B%5D)%3A%20void%20%7B%0D%0A%20%20%20%20%2F%2F%20...%0D%0A%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20%40log%20decorator%0D%0Afunction%20log(debug%3A%20boolean)%20%7B%0D%0A%20%20%2F%2F%20...%0D%0A%20%20const%20logFn%20%3D%20debug%20%3F%20Logger.debug.bind(Logger)%20%3A%20Logger.log.bind(Logger)%3B%0D%0A%0D%0A%20%20%2F%2F%20...%0D%0A%0D%0A%20%20%2F%2F%20Errors%20with%20Argument%20of%20type%20'string'%20is%20not%20assignable%20to%20parameter%20of%20type%20'object%20%7C%20undefined'%0D%0A%20%20%2F%2F%20NOTE%3A%20This%20doesn't%20error%20without%20the%20.bind()%20call%20above%0D%0A%20%20logFn(%22message%22%2C%201%2C%202%2C%203)%3B%0D%0A%7D
Related Issues:
#28567
The text was updated successfully, but these errors were encountered: