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.
Comment 1 by roc...@chromium.org
, Oct 18Thanks for filing. There's an easy way to fix this, we can just generate return {}; instead of trying to do something more clever.