Repository: TypeScript
Issue: Implicitly typed parameters of function properties of generic parameters break autocompletion
Labels: Bug,Domain: Completion Lists

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->
generic parameter autocomplete
extends autocomplete
parameter breaks autocomplete
implicit parameter breaks autocomplete

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about (almost?) everything
- I was unable to test this on prior versions because TS v3.3.3 acts function parameters as implicitly any, while 3.5.1 and higher versions(_the ones on the playground_) correctly get the type as a string.

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEAoGUEsFsAcA20Bm0CmATAlAKGgHYAu6ATigIYDG6okJ8AIumgdEdAPYGgDeuoUByKJ0ALlABnIqUIBzANwDQ6AhQBGozBJkBXWgB8I4FJ04TpsgnOygAvAD5Q6s6IoFsSgL65cIUAAqnKAUAG6c0JiBkKAopJywoGqk8QDu8kIAFrQA1ugAnpJCwQDklvIlIQRRmCyE7FwERUTBAFa60nQMzKwN3LgougRUHNygtazo9OjwkgA8ASoAHiTVRQBK6FScpJhzefmcKIEANF0zPfWjBA4O4NIzkhIBtvyCpOhEuqQ8D7Pevm2TSIdACAFEAAoxOzjOoEKYMSTgN5CdDSCQowTCUQSEoBNFEEonZSCVQaLQ6Uj6YmCLw05wUUgYklCdg40AlABiZlAACFGUSWWTNFgJCYzBYZPJbI5YmYAHSiaxETKgJwABjO-gA6tkeCroEVDSo1CLMGd1BQAF4Y0Dy+2gLygOSfIoUXQtAC02wQomuLP8wopEBlThKpk4JUVqjkKrVoE1oB1eqyxuNQawFuttvt8sdztdIQ9nG9CSQn0aAbAGe0EEsoakMmjytVGqTYF1qlTRqKNazNr4dodTswnDRoAAcgB5RYukHur0+8v+2n0kCWgeY0BVk3k0Uh+xOADaAF15UCqBQiOAj6AAIygE-YZux1sJrUdlMGnu7s1nBclkufqNKA2QfI20CIIgoCpDsOSSDuNZihGDYAISoRGH6gJ2+qZGmvamlo-7FqWvoVmMYG0NInCzDBcHyMoIA+F4ni+P4ATZKA2y1M46CIJwqSgMapikFx3AkCsVRRFQ8SSJI3rZFQOQZCqtDqOgmRhFwpC4OgSzwDsIJEPk8C0NMtEwsZplHKCkKQEo7GcRQcBCUUc4cNYWRUQwSQULA47uFEnCqaJVnjqkeGiCEiCSMEmmhBkACSxB8cgkCqJItARV2Ez1J5qmNo8un6YZQgmWZDATn544wgcNnmZISh6QZpBGeVoAAMLcJgfRqIgDX2HwyhHjEhCgHVxwNSeEgNSNJ5HiUNYlCeyyrJgzRUrQAD8SToKEZCgDN3hHhN5yzCeSh+GAua4EAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
// (Simplified)
interface StepDefinition {
  title: string;
  enabled: true | ((foo: string) => boolean);
}

// To avoid TS from narrowing the keys to 'string' and definitions to just StepDefinition
function defineSteps<T extends Record<keyof T, StepDefinition>>(steps: T) {
  return steps;
}

const STEPS = defineSteps({
  test: {
    title: 'Test',
    enabled: true,
  },
  bar: {
    title: 'Foo Bar',
    enabled: (foo: string) => foo.length > 0, // When this is enabled, baz: { ... } gets auto-completion
    // enabled: () => 'foo'.length > 0, // When this is enabled, baz: { ... } gets auto-completion
    // enabled: (str) => str.length > 0 // When this is enabled, baz: { ... } does NOT get auto-completion
  },
  //baz: {
    
    // enabled: () => [].concat([ 1 ]).length > 0, // When this is enabled, auto-completion here still works
    // enabled: (foo) => !!foo, // When this is enabled, auto-completion here stops working
  //}
});

// The code below is for context
export type Steps = typeof STEPS;

// The aim is getting the step names and other types while also having IntelliSense when defining the steps
export type StepNames = keyof Steps;
export type ConditionalSteps = {
  [S in keyof Steps]: Steps[S]['enabled'] extends true ? never : S;
}[keyof Steps];

// ...

```

### 🙁 Actual behavior

<!-- What happened, and why it was wrong -->
No autocomplete inside `defineSteps({ ... })` after defining a function with an implicitly typed parameter in any of `enabled` properties. TS can't even get the parameter type implicitly on v3.3.3, so my guess is some stuff got improved which helped to infer the type, but there is something slightly wrong under the carpet, which causes this.

### 🙂 Expected behavior

<!-- What you expected to happen instead, and why -->
Getting autocomplete inside `defineSteps({ ... })`, even when I define a function with an implicitly typed parameter.