Recursive Reference of Interface to itself as base type in 4.0.2 (regression?)
See original GitHub issueTypeScript Version: 4.0.2
Search Terms: circularly, recursive, interface, Pick, keyof
Expected behavior: pass
Actual behavior:
Type 'A' recursively references itself as a base type.(2310)
Related Issues:
Code
interface B{
a: string;
b: string;
}
interface A extends Pick<B, keyof A> {
b: string;
}
Output Compiler Options Playground Link: Provided
It would pass in Typescript 3.9.2, but failed in Typescript 4.0.2.
We use this construct to ensure, that interfaces, like A, are subsets of interfaces, like B. If this is intended behaviour, could you please provide a code sample to this construct to ensure that Interface A is containing only keys of interface B in Typescript 4.0.2?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Generate a typescript interface that references itself
I am trying to programmatically infer an interface which references itself. I am writing some code which can encode a recursive structure in ......
Read more >Changes — zope.interface 5.5.3.dev0 documentation
This can be used to fix the reference counting issue mentioned above, as well as to update the data structures when custom data...
Read more >R News - The Comprehensive R Archive Network
Objects of class "POSIXlt" created in this version of R always have 11 components: component zone is always set, and component gmtoff is...
Read more >fhR-4.0.2-foss-2019b - Fred Hutch Biomedical Data Science ...
R with addition libraries from user requests. This release has a new name, placing 'fh' as a prefix. Two modules are created for...
Read more >CHANGES - external/github.com/swig/swig - Git at Google
the C/C++ layer. const reference enums and C++11 enum classes are also now ... base class method when both classes are nested inside...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We removed for now our “recursive references” but I would like that this works again in Typescript 4
The user @jcalz is also here 😄