error: unexpected `optional` modifier in method signature
  --> testdata/parser/method/bad_type.proto:20:14
   |
20 |     rpc Bar1(optional foo.Bar) returns (foo.Bar);
   |              ^^^^^^^^
  help: delete it
   |
20 | -     rpc Bar1(optional foo.Bar) returns (foo.Bar);
20 | +     rpc Bar1(foo.Bar) returns (foo.Bar);
   |
   = help: `optional` only applies to a message field

error: unexpected `repeated` modifier in method signature
  --> testdata/parser/method/bad_type.proto:21:32
   |
21 |     rpc Bar2(foo.Bar) returns (repeated foo.Bar);
   |                                ^^^^^^^^
  help: delete it
   |
21 | -     rpc Bar2(foo.Bar) returns (repeated foo.Bar);
21 | +     rpc Bar2(foo.Bar) returns (foo.Bar);
   |
   = help: `repeated` only applies to a message field

error: unexpected `repeated` modifier in method signature
  --> testdata/parser/method/bad_type.proto:22:31
   |
22 |     rpc Bar2(foo.Bar) returns repeated foo.Bar;
   |                               ^^^^^^^^
  help: delete it
   |
22 | -     rpc Bar2(foo.Bar) returns repeated foo.Bar;
22 | +     rpc Bar2(foo.Bar) returns foo.Bar;
   |
   = help: `repeated` only applies to a message field

error: missing `(...)` around method return type
  --> testdata/parser/method/bad_type.proto:22:31
   |
22 |     rpc Bar2(foo.Bar) returns repeated foo.Bar;
   |                               ^^^^^^^^^^^^^^^^
  help: insert (...) around the return type
   |
22 |     rpc Bar2(foo.Bar) returns (repeated foo.Bar);
   |                               +                +

error: unexpected type in method parameter list
  --> testdata/parser/method/bad_type.proto:23:14
   |
23 |     rpc Bar3(map<string, foo.Bar>) returns (foo.Bar);
   |              ^^^^^^^^^^^^^^^^^^^^ expected message type

error: expected exactly one type in method parameter list, got 2
  --> testdata/parser/method/bad_type.proto:24:13
   |
24 |     rpc Bar4(string, foo.Bar) returns (foo.Bar);
   |             ^^^^^^^^^^^^^^^^^

error: expected exactly one type in method return type, got 2
  --> testdata/parser/method/bad_type.proto:25:31
   |
25 |     rpc Bar5(foo.Bar) returns (foo.Bar, stream string);
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^

error: unexpected `repeated` modifier in method signature
  --> testdata/parser/method/bad_type.proto:26:21
   |
26 |     rpc Bar6(stream repeated foo.Bar) returns (foo.Bar);
   |                     ^^^^^^^^
  help: delete it
   |
26 | -     rpc Bar6(stream repeated foo.Bar) returns (foo.Bar);
26 | +     rpc Bar6(stream foo.Bar) returns (foo.Bar);
   |
   = help: `repeated` only applies to a message field

error: unexpected type in method parameter list
  --> testdata/parser/method/bad_type.proto:27:21
   |
27 |     rpc Bar7(stream map<string, foo.Bar>) returns (foo.Bar);
   |                     ^^^^^^^^^^^^^^^^^^^^ expected message type

error: unexpected nested extension path in method parameter list
  --> testdata/parser/method/bad_type.proto:29:18
   |
29 |     rpc Bar8(foo.(bar.baz)) returns (buf.build/x.y);
   |                  ^^^^^^^^^

error: unexpected `/` in path in method return type
  --> testdata/parser/method/bad_type.proto:29:47
   |
29 |     rpc Bar8(foo.(bar.baz)) returns (buf.build/x.y);
   |                                               ^
   |                                               |
   |                                               help: replace this with a `.`

encountered 11 errors
