Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2910800

Browse files
committed
type name generator ignored names of nested classes
1 parent a80c685 commit 2910800

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/runtime/TypeManager.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,23 @@ static void GetPythonTypeName(Type clrType, System.Text.StringBuilder target)
217217
}
218218

219219
target.Append(']');
220+
221+
int nestedStart = fullName.IndexOf('+');
222+
while (nestedStart >= 0)
223+
{
224+
target.Append('.');
225+
int nextNested = fullName.IndexOf('+', nestedStart + 1);
226+
if (nextNested < 0)
227+
{
228+
target.Append(fullName.Substring(nestedStart + 1));
229+
}
230+
else
231+
{
232+
target.Append(fullName.Substring(nestedStart + 1, length: nextNested - nestedStart - 1));
233+
}
234+
nestedStart = nextNested;
235+
}
236+
220237
return;
221238
}
222239
}

0 commit comments

Comments
 (0)