You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
overload implemented with interface will cause error
Type '(arg: 1 | 2) => "1" | "2"' is not assignable to type 'Func'.
Type '"1" | "2"' is not assignable to type '"1"'.
Type '"2"' is not assignable to type '"1"'.ts(2322)
π Expected behavior
these two implementations both should work
The text was updated successfully, but these errors were encountered:
Singloo
changed the title
function overloads implemented with interface will throw error. but works with normal way
function overloads implemented with interface will throw error
Aug 14, 2023
π Search Terms
"function overloads", "overloads with interface"
π Version & Regression Information
overloads implemented with
interface
behaves differentlyβ― Playground Link
https://www.typescriptlang.org/play?ts=5.3.0-dev.20230814#code/PTAEHUFMBsGMHsC2lQBd5oBYoCoE8AHSAZVgCcBLA1UABWgEM8BzM+AVwDsATAGiwoBnUENANQAd0gAjQRVSQAUCEmYKsTKGYUAbpGF4OY0BoadYKdJMoL+gzAzIoz3UNEiPOofEVKVqAHSKymAAmkYI7NCuqGqcANag8ABmIjQUXrFOKBJMggBcISGgoAC0oACCbvCwDKgU8JkY7p7ehCTkVDQS2E6gnPCxGcwmZqDSTgzxxWWVoASMFmgYkAAeRJTInN3ymj4d-jSCeNsMq-wuoPaOltigAKoASgAywhK7SbGQZIIz5VWCFzSeCrZagNYbChbHaxUDcCjJZLfSDbExIAgUdxkUBIursJzCFJtXydajBBCcQQ0MwAUVWDEQC0gADVHBQGNJ3KAALygABEAAkYNAMOB4GRonzFBTBPB3AERcwABS0+mM9ysygc9wASmCGQUZGSDCWADEuLBQABvRQlFVkZj5UAARh1Tr5zr5AG5baB7Y7QAAmN38wPexQAX2CEPFNBlNGSFqd5vMPL9jmYOp5AD5rb6EemHTzubzXaAnKh8V4PXyxMJ4z6SgX-cXecHy5BK2Rq2G62jKahG1g2BJ+pBRzSyGwyEq+ZxIHoyHydT6Iz7FInzPVGjiLYH-U7g+6wz7N7Bt14z-uM07Xe7PaeLRfd+Zrw7b6AAD5BrM2pupFsS1LLMKyrflPT7Bt8wAjNWx-Dsux7WsGHrRoqSHLJ4FHecJyncUlQAcnnRcCL1KNFBjMgaCtF9YEDUAoxUHBmg8btQEQcVnGBdgaC+NwzGYdgGGYSB+FgaB1ESDl4D0ERqzpBkmUEWtxX5cAHFQAjhAAOXHPkghUAB5L4yHeQRRK0TsrlQRwFFcaQ8A7DidGGLB9BQBBEGhYRLj4iRxWiEQDA4bEFiYVgOB4IISiAA
π» Code
π Actual behavior
overload implemented with
interface
will cause errorπ Expected behavior
these two implementations both should work
The text was updated successfully, but these errors were encountered: