microsoft / TypeScript-Twoslash-Repro-Action

A GitHub Action which evaluates twoslash bug reproductions in GitHub Issues
MIT License
11 stars 7 forks source link

Completions bug #6

Open orta opened 4 years ago

orta commented 4 years ago
function returnFoo<T extends {a: 1, b: 2}>(foo: T): T {
    return foo;
}

// ✅ auto-completion works
returnFoo({  })
//          ^|
// ❌ auto-completion broken
returnFoo({  } as const)
//          ^|
orta commented 4 years ago

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

typescript-bot commented 4 years ago

Hi all, it looks like something has changed with this repro on the nightly version of TypeScript. You can see what has changed here between 1234 and [object Object] [here](https://github.com/microsoft/TypeScript/compare/1234...[object Object]).


Issue body code block by @orta

Before After
Issue body code block by @orta

:bangbang: Exception: Error - Twoslash: The ^| query at line 8 in index.ts did not return any completions ``` Error: Twoslash: The ^| query at line 8 in index.ts did not return any completions at /[root]/index.js:917:21 at Array.map () at _loop4 (/[root]/index.js:879:40) at Object.twoslasher (/[root]/index.js:946:17) at /[root]/index.js:2863:29 at Array.map () at Object.runTwoslashRuns (/[root]/index.js:2834:43) at run (/[root]/index.js:1418:43) at processTicksAndRejections (internal/process/task_queues.js:93:5) ```

Issue body code block by @orta

:x: 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

typescript-bot commented 4 years ago

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
:x: Failed: -
  • Property 'tag' does not exist on type 'never'.

:+1: Compiled

typescript-bot commented 2 years ago

:wave: 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

:x: Failed: -

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

:x: 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