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

Issue 896777 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

MinVersion'd enums fail to compile if they are embedded in a struct

Project Member Reported by beccahughes@chromium.org, Oct 18

Issue description

MinVersion'd enums fail to compile if they are embedded in a struct

  struct MediaSessionInfo {
    enum PlaybackState {
      ...
    }

    [MinVersion=1] PlaybackState playback_state;
  }

the generated shared header:

  MediaSessionInfo_PlaybackState playback_state() const {
    if (data_->header_.version < 1)
      return ::media_session::mojom::MediaSessionInfo::PlaybackState{};
    return static_cast<MediaSessionInfo_PlaybackState>(data_->playback_state);
  }

This fails to compile because it cannot find ::media_session::mojom::MediaSessionInfo.

Taking the enum outside of the struct works though.
 
Thanks for filing. There's an easy way to fix this, we can just generate

  return {};

instead of trying to do something more clever.

Sign in to add a comment