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

Activate features per source file #61

Open
marler8997 opened this issue Dec 21, 2018 · 2 comments
Open

Activate features per source file #61

marler8997 opened this issue Dec 21, 2018 · 2 comments

Comments

@marler8997
Copy link
Collaborator

marler8997 commented Dec 21, 2018

Provide a way to activate new features. We could piggyback off the version feature for this. First we need to know if the "activate new features" feature is supported. We can do this by defining a version in the compiler when it is supported, i.e.

version (CanActivateFeatures)
{
    
}

If your source code requires new features, you could so something like

version (CanActivateFeatures)
{
    //...
}
else static assert(0, "This code does not work with this compiler, it does not support activating new features");

Then to activate new features, you could use versions as well

version (CanActivateFeatures
{
    version = EnableInterpolatedStrings;
}

You can also do this:

version (CanActivateFeatures
{
    version (SupportsInterpolatedStrings)
    {
        version = EnableInterpolatedStrings;
    }
    else static assert (0, "This code requires InterpolatedString support");
}
@wilzbach
Copy link
Collaborator

Non-complete list of things which this flag should activate.

@ntrel
Copy link
Contributor

ntrel commented Mar 22, 2019

scope should be the default for parameters, and have e.g. @escape to mark escaping parameters.

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

No branches or pull requests

3 participants