Skip to content
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

Completions bug #6

Open
orta opened this issue Jul 5, 2020 · 4 comments
Open

Completions bug #6

orta opened this issue Jul 5, 2020 · 4 comments
Labels
has repro indicates there's a twoslash repro in the issue

Comments

@orta
Copy link
Contributor

orta commented Jul 5, 2020

function returnFoo<T extends {a: 1, b: 2}>(foo: T): T {
    return foo;
}

// ✅ auto-completion works
returnFoo({  })
//          ^|
// ❌ auto-completion broken
returnFoo({  } as const)
//          ^|
@orta orta added the has repro indicates there's a twoslash repro in the issue label Jul 5, 2020
@orta
Copy link
Contributor Author

orta commented Jul 5, 2020

I think this error validation, and the exception being raised should probably not happen in this mode.

@microsoft microsoft deleted a comment from typescript-bot Jul 5, 2020
@microsoft microsoft deleted a comment from typescript-bot Jul 5, 2020
@typescript-bot

This comment has been minimized.

@typescript-bot
Copy link

typescript-bot commented Jul 5, 2020

It looks like something has changed with this repro on today's nightly build of TypeScript. You can see what has changed on TypeScript between 473113 and 9a5c02 here.


Issue body code block by @orta

Before After
❌ Failed: -
  • Property 'tag' does not exist on type 'never'.

👍 Compiled

@typescript-bot
Copy link

typescript-bot commented Apr 13, 2022

👋 Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of the repro in the issue body running against the nightly TypeScript.


Issue body code block by @orta

❌ Failed: -

  • Argument of type '{}' is not assignable to parameter of type '{ a: 1; b: 2; }'. Type '{}' is missing the following properties from type '{ a: 1; b: 2; }': a, b
  • Argument of type '{}' is not assignable to parameter of type '{ a: 1; b: 2; }'. Type '{}' is missing the following properties from type '{ a: 1; b: 2; }': a, b

Historical Information
Version Reproduction Outputs
4.2.2, 4.3.2, 4.4.2, 4.5.2, 4.6.2

❌ Failed: -

  • Argument of type '{}' is not assignable to parameter of type '{ a: 1; b: 2; }'. Type '{}' is missing the following properties from type '{ a: 1; b: 2; }': a, b
  • Argument of type '{}' is not assignable to parameter of type '{ a: 1; b: 2; }'. Type '{}' is missing the following properties from type '{ a: 1; b: 2; }': a, b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has repro indicates there's a twoslash repro in the issue
Projects
None yet
Development

No branches or pull requests

2 participants