Commit 241e17ba authored by Jon Skeet's avatar Jon Skeet

Merge pull request #550 from jskeet/issue307

Fix for doubly-nested types - issue #307.
parents b08b6bf6 8d83f8d1
......@@ -9,6 +9,15 @@ option csharp_namespace = "UnitTest.Issues.TestProtos";
package unittest_issues;
option optimize_for = SPEED;
// Issue 307: when generating doubly-nested types, any references
// should be of the form A.Types.B.Types.C.
message Issue307 {
message NestedOnce {
message NestedTwice {
}
}
}
// Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
// New issue 309: https://github.com/google/protobuf/issues/309
......
......@@ -206,7 +206,7 @@ std::string ToCSharpName(const std::string& name, const FileDescriptor* file) {
// the C# namespace.
classname = name.substr(file->package().size() + 1);
}
result += StringReplace(classname, ".", ".Types.", false);
result += StringReplace(classname, ".", ".Types.", true);
return "global::" + result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment