Skip to content

Add @notUndefined attribute to more Stdlib abstract types #7464

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 17 commits into from
May 13, 2025

Conversation

mediremi
Copy link
Contributor

@mediremi mediremi commented May 12, 2025

Adds the @notUndefined attribute to:

  • Map.t
  • Set.t
  • WeakMap.t
  • WeakSet.t
  • Stdlib_Intl_*
  • Stdlib_AsyncIterator
  • Stdlib_Iterator
  • Stdlib_DataView
  • Stdlib_ArrayBuffer
  • Stdlib_JsError
  • Stdlib_Symbol
  • Stdlib_TypedArray

Copy link

pkg-pr-new bot commented May 12, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7464

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7464

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7464

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7464

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7464

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7464

commit: 2bbdf90

@cknitt
Copy link
Member

cknitt commented May 13, 2025

Thanks, that's great!
But I think there are more candidates, like ArrayBuffer.t, or Symbol.t.

Would you mind looking through all the stdlib/runtime files and extending this PR accordingly?

@nojaf
Copy link
Collaborator

nojaf commented May 13, 2025

@fhammerschmidt should we document this attribute as well?
Is this something users want to use in their own code?

@fhammerschmidt
Copy link
Member

Could be useful for library authoes at least. So yes.

@mediremi
Copy link
Contributor Author

@cknitt I've updated the PR to also add the attribute to any other abstract types I could find in Stdlib 👍

Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Thanks a lot! 🎉

@cknitt cknitt merged commit 3c4b033 into rescript-lang:master May 13, 2025
21 checks passed
@mediremi mediremi deleted the more-not-undefined branch May 24, 2025 16:01
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.

4 participants