syntax = "proto2";

package buf.test;

message M {
    optional S s = 1;
    optional S.X x = 2;
}

service S {
    rpc X(M) returns (M);
}

service S2 {
    // protoc actually rejects this; M will find resolve M to
    // S2.M, not the message M.
    rpc M(M) returns (buf.test.M);
}