-
-
Notifications
You must be signed in to change notification settings - Fork 608
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 D_Preview<name> to identify enabled preview switches #11635
Conversation
Geod24
commented
Aug 28, 2020
This will allow to adapt library code, e.g. Phobos, without having to observe the effect. The downside is that those versions probably need to go through deprecation after the flag is disabled, something which wouldn't be needed if the user was only observing the effect.
Thanks for your pull request, @Geod24! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#11635" |
What about allowing only code from druntime to access these versions (or traits)?
And eventually it would become:
OTOH the same could be achieved without this intermediate step with a mentioned trait and it wouldn't necessarily require a deprecation phase as the trait could return Edit: more importantly this also needs to take the |
I also wanted to use it in other libraries (e.g. I would like to have Vibe.d ready when v2.094.0 is released).
True, I just thought a
It checks that the field is set, and |
Well, the same argument can be made about introducing so many new version identifiers. |
Not backward compatible.
True, but IMO their meaning is much clearer:
That is slightly different IMO. It makes sense to query the target capability (and also, those can be combined), while those version flags are intended only for a transitional period. I could also remove the changelog entry if you prefer to keep it hidden. Or just bite it and close this, and detect if the feature is enabled with code. |
I'm just worried that we will end up with a whole lot of versions that we can never remove once introduced. |
I think I'm just going to table this, the workaround I have is good enough. |