Navigation Menu

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

Allow more attributes for generic instances #10557

Closed

Conversation

ALANVF
Copy link

@ALANVF ALANVF commented Jan 18, 2022

This is hopefully a fix for #10550 and any other related issues.

These are the metadata that are now allowed on generic type instances:

  • access
  • allow
  • final
  • hack
  • internal
  • keep (this was already allowed)
  • noClosure
  • nullSafety
  • pure
  • struct
  • structInit
  • using

I'm not entirely sure if using will work as intended, but if it doesn't I guess I could change it.
I'm also not sure what to do with autoBuild, build, and genericBuild so I left them out, and I don't see much use for keepInit and keepSub.

(I probably missed some metadata, so those can be added if needed)

@Simn
Copy link
Member

Simn commented Jan 18, 2022

Oh shit, I get to learn new OCaml syntax... :D

And thank you for the contribution!

@ALANVF
Copy link
Author

ALANVF commented Jan 18, 2022

No problem 👍 (also this is by far my favorite ocaml feature, Module.(...)/[/[|/{ opens up Module inside the ...)

@Simn
Copy link
Member

Simn commented Jan 18, 2022

So, while I appreciate learning new syntax, I think a shorter and faster solution here would be a good old List.filter.

@ALANVF
Copy link
Author

ALANVF commented Jan 19, 2022

I don't see that that helps here though, and you'd still probably end up using something similar (just a lot longer)

@Simn Simn closed this in d1a2bd1 Jan 19, 2022
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.

None yet

2 participants