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
Mixin class with type param seems to lose information about default type parameter, causing "base constructors must all have the same return type"
#56005
Open
boconnell opened this issue
Oct 6, 2023
· 0 comments
The line class Bad extends BarableF(Object) {} fails because "Base constructors must all have the same return type". If I hover over BarableF, I see the type
where notably Bar has lost its default type param, which might be causing the issue.
🙂 Expected behavior
I would expect Bad to type-check without a problem, because in the Good example below it, you see that providing a type argument that is the same as the default for the type param causes things to work.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
🔎 Search Terms
Mixin class with type param seems to lose information about default type parameter, causing "base constructors must all have the same return type"
Related:
#37142
#40110
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.2.2#code/CYUwxgNghgTiAEAXAngBwQYQPYDsDOiMArmIljACpogA8FAfPALzxQBGBMUp8OIA7vAAUASmaMKAbgBQ0sLgLwAQrHYQQAMWbw6KvAhAAPRCBzA88bPkIkylajQDybAFbhE9ekL0gAXPAofMSZGAG9peEio9k5uRHhIKDwLFS42dRpU7U4ASxwAc0YjEzMUpIRwqKqotlghQ39cgrFQ+DhEIhgceENJeABfCOrB6raQDq7lVXSQGX6ZOWhkqeB4YtNzKbT1DSFnN1IWwcWkiwBxLCxV9dKttU0913cRGibC+FD+oA
💻 Code
🙁 Actual behavior
The line
class Bad extends BarableF(Object) {}
fails because "Base constructors must all have the same return type". If I hover overBarableF
, I see the typewhere notably
Bar
has lost its default type param, which might be causing the issue.🙂 Expected behavior
I would expect
Bad
to type-check without a problem, because in theGood
example below it, you see that providing a type argument that is the same as the default for the type param causes things to work.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: