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

[NewErrors] 4.8.0-dev.20220609 vs 4.7.3 #49460

Open
typescript-bot opened this issue Jun 9, 2022 · 6 comments
Open

[NewErrors] 4.8.0-dev.20220609 vs 4.7.3 #49460

typescript-bot opened this issue Jun 9, 2022 · 6 comments
Labels
Has Repro

Comments

@typescript-bot
Copy link
Collaborator

@typescript-bot typescript-bot commented Jun 9, 2022

The following errors were reported by 4.8.0-dev.20220609, but not by 4.7.3

kamranahmedse/developer-roadmap

tsconfig.json

  • error TS2344: Type 'K' does not satisfy the constraint 'Record<string, any>'.
    • file:///mnt/ts_downloads/developer-roadmap/node_modules/@chakra-ui/descendant/src/use-descendant.ts#L11
    • file:///mnt/ts_downloads/developer-roadmap/node_modules/@chakra-ui/descendant/src/use-descendant.ts#L87
    • file:///mnt/ts_downloads/developer-roadmap/node_modules/@chakra-ui/descendant/src/use-descendant.ts#L91

coder/code-server

7 of 57 projects failed to build with the old tsc

src/tsconfig.monaco.json

src/tsconfig.tsec.json

microsoft/playwright

4 of 9 projects failed to build with the old tsc

packages/html-reporter/tsconfig.json

vercel/hyper

2 of 3 projects failed to build with the old tsc

tsconfig.json

  • error TS2344: Type 'BaseType' does not satisfy the constraint 'Record<string | number, any>'.
    • file:///mnt/ts_downloads/hyper/app/node_modules/type-fest/ts41/get.d.ts#L93 in app/tsconfig.json
    • file:///mnt/ts_downloads/hyper/app/node_modules/type-fest/ts41/get.d.ts#L94 in app/tsconfig.json
  • error TS2344: Type 'T' does not satisfy the constraint 'Record<string, any>'.
    • file:///mnt/ts_downloads/hyper/app/node_modules/conf/dist/source/types.d.ts#L201 in app/tsconfig.json

react-hook-form/react-hook-form

2 of 3 projects failed to build with the old tsc

tsconfig.json

typeorm/typeorm

tsconfig.json

mobxjs/mobx

7 of 9 projects failed to build with the old tsc

packages/mobx/tsconfig.json

palantir/blueprint

11 of 25 projects failed to build with the old tsc

packages/datetime/src/tsconfig.json

packages/select/src/tsconfig.json

apollographql/apollo-client

tsconfig.json

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Jun 9, 2022

Common issue is something like

export interface Obj {
    [key: string]: any
}

function foo<T>(x: T) {
    let y: Obj = x;
}

@andrewbranch andrewbranch added the Has Repro label Jun 9, 2022
@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Jun 9, 2022

@typescript-bot bisect good v4.7.3 bad main

@typescript-bot
Copy link
Collaborator Author

@typescript-bot typescript-bot commented Jun 9, 2022

The change between v4.7.3 and main occurred at 5aa0053.

@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Jun 9, 2022

It’s nonsense because I didn’t add // @strictNullChecks: true to the repro. But I wonder what change it thinks it picked up on, hah

@ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented Jun 9, 2022

@DanielRosenwasser I'm pretty sure that comes from #49119 (which incorporated the change from #48366). When checking whether an unconstrained type parameter T is assignable to some type X, we used to check whether {} is assignable to X. We now check whether unknown is assignable to X, and in this case it isn't because T could be undefined or null. This seems like a very legit error.

@typescript-bot
Copy link
Collaborator Author

@typescript-bot typescript-bot commented Jun 10, 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 this repro running against the nightly TypeScript.


Comment by @DanielRosenwasser

Failed: -

  • Type 'T' is not assignable to type 'Obj'.

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

👍 Compiled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Has Repro
Projects
None yet
Development

No branches or pull requests

4 participants