question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recursive Reference of Interface to itself as base type in 4.0.2 (regression?)

See original GitHub issue

TypeScript 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:open
  • Created 3 years ago
  • Reactions:8
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Uzlopakcommented, Sep 26, 2020

We removed for now our “recursive references” but I would like that this works again in Typescript 4

1reaction
Uzlopakcommented, Nov 30, 2021

The user @jcalz is also here 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found