Skip to content

Deep intersections stopped working in 4.9 #52397

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

Closed
SephReed opened this issue Jan 24, 2023 · 3 comments · Fixed by #52392
Closed

Deep intersections stopped working in 4.9 #52397

SephReed opened this issue Jan 24, 2023 · 3 comments · Fixed by #52392
Labels
Duplicate An existing issue was already created

Comments

@SephReed
Copy link

Bug Report

🔎 Search Terms

Deep union no longer work

🕗 Version & Regression Information

  • This is a crash: no
  • This changed between versions _4.8 and 4.9
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about yes_
  • I was unable to test this on prior versions because tested on prior versions, is regression___

⏯ Playground Link

Playground link with relevant code

💻 Code

type G = { props: (
  { a: { foo: 1 }}
  & { a: { bar: 2 }}
)} & { props: { a: { qux: 3}}}

const g: G = {
  props: {
    a: {
      foo: 1,
      bar: 2,
      qux: 3,  // gives error in 4.9, not in 4.8
    }
  }
}

🙁 Actual behavior

qux gives error:

Object literal may only specify known properties

🙂 Expected behavior

Continues working as it had before

@SephReed SephReed changed the title Deep unions stopped working in 4.9 Deep intersections stopped working in 4.9 Jan 24, 2023
@SephReed
Copy link
Author

This one still works:

type G = { props: { a: { foo: 1 }}} 
  & { props: { a: { qux: 3}}} 
  & { props: { a: { bar: 2 }}}  

@RyanCavanaugh
Copy link
Member

Tracking at #52252 since the PR to fix that one also fixes this one

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants