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

Add @scala.annotation.preview annotation and -preview flag. #22317

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

WojciechMazur
Copy link
Contributor

This adds @scala.annotation.preview and -preview flag to enable definition and usage of experimental-like features.

@preview features follows the same rules as @experimental with exception of being non viral - we're not automatically adding @preview annotation to when refering to preview definitions, but still require preview scope (by either -preview flag or top level scala.language.preview.<feature>)

@soronpo
Copy link
Contributor

soronpo commented Jan 7, 2025

So what happens when a library uses a preview feature and publishes? A user can depend on it without turning on preview?

@WojciechMazur
Copy link
Contributor Author

So what happens when a library uses a preview feature and publishes? A user can depend on it without turning on preview?

Yes, user can depend on it without turning on preview as long as the exposed API does not use any preview features. Preview features can become an implementation detail that is not exposed to referrer of definition.

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.

Introduce concept of Preview Features as a feature stabilization period
2 participants