-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[TypeName] Nested types should respect MaxNode count #106334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
6cdd040
da4df69
f3183e0
84c7fbc
3f93356
43082d5
815d8af
b90de5b
593b00d
2a56a1f
09e2901
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,22 +284,25 @@ public int GetNodeCount() | |
| { | ||
| int result = 1; | ||
|
|
||
| if (IsNested) | ||
| { | ||
| result += DeclaringType.GetNodeCount(); | ||
| } | ||
| else if (IsConstructedGenericType) | ||
| TypeName? declaring = _declaringType; | ||
| while (declaring is not null) | ||
| { | ||
| result++; | ||
| declaring = declaring._declaringType; | ||
| } | ||
| else if (IsArray || IsPointer || IsByRef) | ||
|
|
||
| if (IsArray || IsPointer || IsByRef) | ||
| { | ||
| result += GetElementType().GetNodeCount(); | ||
| } | ||
|
|
||
| foreach (TypeName genericArgument in GetGenericArguments()) | ||
| else if (IsConstructedGenericType) | ||
| { | ||
| result += genericArgument.GetNodeCount(); | ||
| result += GetGenericTypeDefinition().GetNodeCount(); | ||
|
|
||
| foreach (TypeName genericArgument in GetGenericArguments()) | ||
| { | ||
| result += genericArgument.GetNodeCount(); | ||
|
||
| } | ||
| } | ||
|
|
||
| return result; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.