-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Regression on inference of "old style" recursive interfaces in 3.7.x #34796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Jessidhia and @RyanCavanaugh I've made a repro for this https://github.com/jonathaningram/ts-34796 I've no idea what's going on though. You can see in the commit (jonathaningram/ts-34796@fbd9755) that caused this to fail it was me adding in I hope this repro helps—we extracted it from our app into minimal a codebase as possible. |
Converts self-referential interfaces to recursive types (works around microsoft/TypeScript#34796). Recursive types only exist in 3.7 so this uses typesVersions. Finally enables code paths that were commented out because they'd break on TypeScript versions older than 3.2.
Convert self-referential interfaces to recursive types to work aroundhttps://github.com/microsoft/TypeScript/issues/34796
Converts self-referential interfaces to recursive types to work around microsoft/TypeScript#34796 Now that the types _really_ had to be updated for a new version, there's no longer any reason to keep compatibility definitions for old versions of TypeScript around, so removed the ones that were already marked as such. This fixes the types for the as= property.
The linked repo now compiles without (that) error in TS 5.0. |
TypeScript Version: 3.7.1-rc
Search Terms: recursive
Code
Expected behavior:
To build the same as in 3.6. While recursive
type
s are a new feature, they shouldn't affect how recursiveinterface
extend
s work.Actual behavior:
"No overload matches this call" unless the
export interface FlattenInterpolation<P> extends ReadonlyArray<Interpolation<P>> {}
in the@types/styled-components
definition is edited to beexport type FlattenInterpolation<P> = ReadonlyArray<Interpolation<P>>
instead; this edit is sufficient to fix all type errors, but would make the types incompatible with typescript <3.7.0.Playground Link: TODO
Related Issues: maybe #33872 but probably not
EDIT: I've spent about 2h on this but I still am failing to reduce it to a failing case... will probably have to revisit tomorrow. There definitely is something here, though, but I don't know yet what I am missing in the attempt so far; it's possible trying to simplify React to just being a function call / ignoring object styles to simplify things is also avoiding the bug.
The text was updated successfully, but these errors were encountered: