unittest_swift_extension.proto 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Protos/unittest_swift_extension.proto - test proto
  2. //
  3. // This source file is part of the Swift.org open source project
  4. //
  5. // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
  6. // Licensed under Apache License v2.0 with Runtime Library Exception
  7. //
  8. // See http://swift.org/LICENSE.txt for license information
  9. // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
  10. //
  11. // -----------------------------------------------------------------------------
  12. ///
  13. /// Test handling of extensions to deeply nested messages.
  14. ///
  15. // -----------------------------------------------------------------------------
  16. syntax = "proto2";
  17. package protobuf_unittest.extend;
  18. message Foo {
  19. message Bar {
  20. message Baz {
  21. optional int32 a = 1;
  22. extensions 100 to 1000;
  23. }
  24. }
  25. }
  26. extend Foo.Bar.Baz {
  27. optional string b = 100;
  28. optional group C = 101 {
  29. optional int64 c = 999;
  30. // extensions 10 to 20;
  31. }
  32. }
  33. /*
  34. extend Foo.Bar.Baz.C {
  35. optional bool d = 12;
  36. }
  37. */