Skip to content

Fix issue with JSX V4 and newtype #6029

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

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Fix issue with JSX V4 and newtype #6029

merged 1 commit into from
Mar 3, 2023

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Mar 3, 2023

Make the following changes:

  1. Don't replace type variable a with "type-a", but leave it alone.
  2. If the original make uses (type a b, ... wrap the first generated make with the same new type definitions
  3. In the constraint :props<'a, 'b> where 'a and 'b were not constrained, use :props<_, _> instead. This avoids issues when e.g. 'a is inferred to be a newtype bound in the make function, which would need to be mentioned explicitly and would give a type error.

Fixes #5978 Replaces #6000

@cristianoc cristianoc requested a review from mununki March 3, 2023 14:14
cristianoc added a commit to rescript-lang/syntax that referenced this pull request Mar 3, 2023
cristianoc added a commit to rescript-lang/syntax that referenced this pull request Mar 3, 2023
Make the following changes:
1) Don't replace type variable `a` with `"type-a`",  but leave it alone.
2) If the original `make` uses `(type a b, ...` wrap the first generated `make` with the same new type definitions
3) In the constraint `:props<'a, 'b>` where `'a` and `'b` were not constrained, use `:props<_, _>` instead. This avoids issues when e.g. `'a` is inferred to be a newtype bound in the make function, which would need to be mentioned explicitly and would give a type error.

Fixes #5978
Replaces #6000
Copy link
Member

@mununki mununki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

cristianoc added a commit to rescript-lang/syntax that referenced this pull request Mar 3, 2023
@cristianoc cristianoc merged commit bf8f1a3 into master Mar 3, 2023
@cristianoc cristianoc deleted the jsx_v4_newtype branch March 3, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSXv4: Locally abstract types do not seem to be in scope in the component body
2 participants