Skip to content

Conversation

@marler8997
Copy link
Contributor

@marler8997 marler8997 commented Mar 28, 2018

PR dlang/dmd#7996 is modifying the compiler to comply with the language specification:

The value of an EnumMember is given by its AssignExpression. If there is no AssignExpression and it is the first EnumMember, its value is EnumBaseType.init.

The current behavior is to assign the value 0 to the first enum member when no assign expression is given. The referenced PR introduces a deprecation message when an enum's base type's .init member is not 0. This applies to the types double, char and real. This allows applications to maintain the current behavior for a time until the deprecation is over and the behavior will change to match the specification. Note that this means you cannot currently create an enum with base type double, char or real without a deprecation message unless you give it's first member an explicit assignment. Since phobos treats deprecations as errors, this PR provides explicit assignments in these cases during this deprecation period.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @marler8997! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + phobos#6368"

@dlang-bot dlang-bot merged commit 88b088a into dlang:master Mar 29, 2018
@JackStouffer
Copy link
Contributor

@WalterBright PRs need at least one approval to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants