| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- // Protos/unittest_swift_enum_optional_default.proto - test proto
- //
- // This source file is part of the Swift.org open source project
- //
- // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
- // Licensed under Apache License v2.0 with Runtime Library Exception
- //
- // See http://swift.org/LICENSE.txt for license information
- // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
- //
- // -----------------------------------------------------------------------------
- ///
- /// Test handling of enum fields with specified defaults
- ///
- // -----------------------------------------------------------------------------
- syntax = "proto2";
- package protobuf_unittest.extend;
- message EnumOptionalDefault {
- message NestedMessage {
- enum Enum {
- FOO = 0;
- }
- // The circular reference here forces the generator to
- // implement heap-backed storage.
- optional NestedMessage message = 1;
- optional Enum optional_enum = 17 [default = FOO];
- }
- message NestedMessage2 {
- enum Enum {
- FOO = 0;
- }
- optional Enum optional_enum = 17 [default = FOO];
- }
- }
|