error: unexpected `optional` modifier in method signature
  --> testdata/parser/method/bad_type.proto:6:14
   |
 6 |     rpc Bar1(optional foo.Bar) returns (foo.Bar);
   |              ^^^^^^^^
  help: delete it
   |
 6 | -     rpc Bar1(optional foo.Bar) returns (foo.Bar);
 6 | +     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:7:32
   |
 7 |     rpc Bar2(foo.Bar) returns (repeated foo.Bar);
   |                                ^^^^^^^^
  help: delete it
   |
 7 | -     rpc Bar2(foo.Bar) returns (repeated foo.Bar);
 7 | +     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:8:31
   |
 8 |     rpc Bar2(foo.Bar) returns repeated foo.Bar;
   |                               ^^^^^^^^
  help: delete it
   |
 8 | -     rpc Bar2(foo.Bar) returns repeated foo.Bar;
 8 | +     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:8:31
   |
 8 |     rpc Bar2(foo.Bar) returns repeated foo.Bar;
   |                               ^^^^^^^^^^^^^^^^
  help: insert (...) around the return type
   |
 8 |     rpc Bar2(foo.Bar) returns (repeated foo.Bar);
   |                               +                +

error: unexpected type in method parameter list
  --> testdata/parser/method/bad_type.proto:9:14
   |
 9 |     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:10:13
   |
10 |     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:11:31
   |
11 |     rpc Bar5(foo.Bar) returns (foo.Bar, stream string);
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^

error: unexpected `repeated` modifier in method signature
  --> testdata/parser/method/bad_type.proto:12:21
   |
12 |     rpc Bar6(stream repeated foo.Bar) returns (foo.Bar);
   |                     ^^^^^^^^
  help: delete it
   |
12 | -     rpc Bar6(stream repeated foo.Bar) returns (foo.Bar);
12 | +     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:13:21
   |
13 |     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:15:18
   |
15 |     rpc Bar8(foo.(bar.baz)) returns (buf.build/x.y);
   |                  ^^^^^^^^^

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

encountered 11 errors
