New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 619693 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Mojom: empty enum is not supported

Project Member Reported by yzshen@chromium.org, Jun 13 2016

Issue description

Although it is not very common to define an empty enum, the following is a legitimate use case:

[Extensible]
enum SomeEnum {};

 
Components: Internals>Mojo
Components: -Internals>Mojo Internals>Mojo>Bindings

Comment 3 by w...@chromium.org, Mar 10 2017

Owner: w...@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/497ec8da95fdb294957278ebd8dc49d5f88b980f

commit 497ec8da95fdb294957278ebd8dc49d5f88b980f
Author: watk <watk@chromium.org>
Date: Tue Mar 14 02:54:14 2017

mojo bindings: Support enums with no values

Previously it was invalid to define an empty enum, i.e.:

  enum A {};

Now empty enums are a valid declaration. In practice it's not useful to
have an empty, non-extensible enum because all values will fail message
validation. However, an extensible empty enum may be useful because all
 values are valid for it.

BUG= 619693 
TEST=existing tests & new bindings conformance test

Review-Url: https://codereview.chromium.org/2741943002
Cr-Commit-Position: refs/heads/master@{#456596}

[add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.data
[add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.expected
[add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.data
[add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.expected
[modify] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom
[modify] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl
[modify] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/tools/bindings/pylib/mojom/parse/parser.py

Comment 5 by w...@chromium.org, Mar 14 2017

Status: Fixed (was: Started)

Sign in to add a comment