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
Actual behavior:
Error on the interface Textbox declaration
Interface 'Textbox' cannot simultaneously extend types 'Events<TextboxEvents>' and 'Widget'.
Named property 'emit' of types 'Events<TextboxEvents>' and 'Widget' are not identical.
Came across this while upgrading our project from 3.5.2 to 3.7.2, we rely pretty heavily in our typings for a JS library on the above pattern. I looked through the list of breaking changes for TS 3.6
but didn't see anything related to the issue. I note that it is quite similar to #16936 but opted to open a new issue since this was accepted by the compiler in prior versions where that ticket was never considered fixed.
Also, sorry about the title, hopefully the code makes it more obvious what I'm talking about!
The text was updated successfully, but these errors were encountered:
This is the intended behavior; prior versions of TS had a bug where certain conflicts were not correctly detected. The types of these properties don't agree and you need to resolve the conflict.
declareconstw: Widget;// OKw.emit("onclick",nullasany);// Errorw.emit("textchanged",nullasany)declareconstet: Events<TextboxEvents>;// OKet.emit("onclick",nullasany);// OKet.emit("textchanged",nullasany);declareconstt: Textbox;// OKt.emit("onclick",nullasany);// Is this supposed to be an error or not?// The two base interfaces disagreet.emit("textchanged",nullasany)
TypeScript Version:
3.6.3-Nightly (this was working in 3.5.2 and prior)
Search Terms:
extends multiple compatible interfaces not identical
Code
Expected behavior:
Works, no errors
Actual behavior:
Error on the
interface Textbox
declarationand similar for
on
.Playground Link:
https://www.typescriptlang.org/play/?ts=3.8.0-dev.20191105&ssl=1&ssc=1&pln=31&pc=1#code/JYOwLgpgTgZghgYwgAgKIDcLgM4B4AqAfMgN4CwAUMtchALbBi4DStAHpCACbbIDWEAJ4B7GMiIAKEHDoQAXMmYAaZMIBGAKwX4A2swC6ASgXphwLgG5KNVSBbtOPfkNHjCUmfMUqYAVxAIChLqWuJ6RsgAvMSm5sbIsZaUAL6UaRSgkLCIKADq5gDmEGAYWGC85FQ0wgEANsAIfAoAssK+2BCl4FYUqRSUmdDwSMj5XEVgDlhOXeW4YxOz2MSVNgD0a8gAdDsp6QPgQzniEBxqwmxLU9y8C8VXqzSQHAgAFnAgRVwKzELncFAuLMen0Dllhih8KcwOc2NcZpgcARobCloQVHdJo9qBttrtevsKFwIAhagCUAgathJgB3BSYnrE0nk5CUkDU5BgbQoi49Sg0rY1CQAIhqpIafGFKhQ0VIyGShkoYEFIBFYvqjSltCiK3liooyqFwueYDeHy+WpluoVFiAA
Related Issues: #8606, #16936
Came across this while upgrading our project from 3.5.2 to 3.7.2, we rely pretty heavily in our typings for a JS library on the above pattern. I looked through the list of breaking changes for TS 3.6
but didn't see anything related to the issue. I note that it is quite similar to #16936 but opted to open a new issue since this was accepted by the compiler in prior versions where that ticket was never considered fixed.
Also, sorry about the title, hopefully the code makes it more obvious what I'm talking about!
The text was updated successfully, but these errors were encountered: