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

Don't generate ill-formed TS polymorphic types #86

Open
LPTK opened this issue Feb 28, 2022 · 0 comments
Open

Don't generate ill-formed TS polymorphic types #86

LPTK opened this issue Feb 28, 2022 · 0 comments
Assignees

Comments

@LPTK
Copy link
Contributor

LPTK commented Feb 28, 2022

Currently we use parameter lists in places which are not valid in TS.

Example:

:ts
let t = { a = 5; b = "world"} in if t.a == 1 then 1 else (fun f -> f.b )
//│ res: {b: 'a} -> 'a | 1
//│ // start ts
//│ export declare const res<a>: (arg1: {b: a}) => a | 1
//│ // end ts

We should just fail TS generation here, or widen the type until it's representable.

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

No branches or pull requests

2 participants