Skip to content

Gentype: handle null/nullable/undefined from Stdlib - #7132

Merged
cknitt merged 2 commits into
masterfrom
gentype-pervasives
Feb 19, 2025
Merged

cknitt merged 2 commits into
masterfrom
gentype-pervasives

Conversation

@cknitt

@cknitt cknitt commented Oct 27, 2024

Copy link
Copy Markdown
Member

No description provided.

@cknitt
cknitt requested a review from cristianoc October 27, 2024 07:48

@cristianoc cristianoc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks great.
Before merging, or perhaps after: we should settle on where these types exist.

Having them exist in 3 or 4 places is an opportunity for issues down the line in tooling (editor, hovering) and compiler updates.

What's the ground truth here?
I guess for each type, we should have a preferred way of expressing that type, at least.
Ideally, a unique way, but that seems difficult to achieve while maintaining backwards compatibility.

Thoughts @zth ?

@cknitt

cknitt commented Oct 27, 2024 •

Copy link
Copy Markdown
Member Author

What's the ground truth here? I guess for each type, we should have a preferred way of expressing that type, at least. Ideally, a unique way, but that seems difficult to achieve while maintaining backwards compatibility.

If we follow my current approach in #7129, the ground truth would be in the CoreTypes module.
Directly in Pervasives won't work because of circular dependency issues.

In any case, we still have to be able to handle the different aliases.

@cknitt

cknitt commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

Will keep this open until #7129 is done, as we'll run into the same issue with any other types we alias in Pervasives (e.g. date).

@cknitt
cknitt force-pushed the gentype-pervasives branch from abfe2bd to d270512 Compare February 18, 2025 08:34
@cknitt cknitt changed the title Gentype: handle null/nullable/undefined from Pervasives Gentype: handle null/nullable/undefined from Stdlib Feb 18, 2025

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: d270512 Previous: 80744a5 Ratio
Print HeroGraphic.res - time/run 13.609067813333333 ms 12.308145193333333 ms 1.11

This comment was automatically generated by workflow using github-action-benchmark.

@cknitt

cknitt commented Feb 18, 2025

Copy link
Copy Markdown
Member Author

Rebased after #7285, please re-review.

@cknitt
cknitt requested a review from zth February 18, 2025 09:05
@cknitt
cknitt requested a review from cristianoc February 19, 2025 07:11
@cknitt
cknitt merged commit 5437d14 into master Feb 19, 2025
@cknitt
cknitt deleted the gentype-pervasives branch February 19, 2025 07:24
aspeddro pushed a commit to aspeddro/rescript-compiler that referenced this pull request Oct 31, 2026
* Gentype: handle null/nullable/undefined from Stdlib

* CHANGELOG

Signed-off-by: Pedro Castro <aspeddro@gmail.com>
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.

2 participants