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

Unexpected type checking fail with jsr when mapped type has a named type #23284

Closed
kuuote opened this issue Apr 8, 2024 · 1 comment · Fixed by #24205
Closed

Unexpected type checking fail with jsr when mapped type has a named type #23284

kuuote opened this issue Apr 8, 2024 · 1 comment · Fixed by #24205
Assignees
Labels
bug Something isn't working correctly jsr Issues or feature requests relating to JSR.io

Comments

@kuuote
Copy link

kuuote commented Apr 8, 2024

Version: Deno 1.42.1

To Reproduce

Save following code and execute deno check a.ts:

import * as u from "jsr:/@core/[email protected]";

const a = u.isObjectOf({
  a: u.isOptionalOf(u.isUnknown),
});

type A = u.PredicateType<typeof a>;

const aa: A = {}; 

Outputs following error:

error: TS2741 [ERROR]: Property 'a' is missing in type '{}' but required in type '{ a: unknown; }'.
const aa: A = {};
      ~~
    at file:///tmp/a.ts:9:7

    'a' is declared here.
      a: u.isOptionalOf(u.isUnknown),
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        at file:///tmp/a.ts:4:3

Note

Same library version from npm passes type cheking.

import * as u from "npm:[email protected]";

const a = u.isObjectOf({
  a: u.isOptionalOf(u.isUnknown),
});

type A = u.PredicateType<typeof a>;

const aa: A = {}; 
@lucacasonato lucacasonato added jsr Issues or feature requests relating to JSR.io bug Something isn't working correctly labels Jun 11, 2024
@dsherret dsherret self-assigned this Jun 11, 2024
@dsherret
Copy link
Member

Sorry we missed this one earlier. I have a fix at swc-project/swc#9038

@dsherret dsherret changed the title Unexpected type checking fail with jsr Unexpected type checking fail with jsr when mapped type has a named type Jun 13, 2024
bartlomieju pushed a commit that referenced this issue Jun 18, 2024
zebreus pushed a commit to zebreus/deno that referenced this issue Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly jsr Issues or feature requests relating to JSR.io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants