Skip to content

Commit 71749a9

Browse files
committed
Don't ignore method-less types when scanning
They might contain nested types with interesting methods. Doh.
1 parent 6f06c21 commit 71749a9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ void Scan (AndroidTargetArch targetArch, AssemblyDefinition assembly, HashSet<st
6767

6868
void Scan (AndroidTargetArch targetArch, TypeDefinition type, HashSet<string> pinvokeCache, List<PinvokeEntryInfo> pinvokes)
6969
{
70+
if (type.HasNestedTypes) {
71+
foreach (TypeDefinition nestedType in type.NestedTypes) {
72+
Scan (targetArch, nestedType, pinvokeCache, pinvokes);
73+
}
74+
}
75+
7076
if (!type.HasMethods) {
7177
return;
7278
}
@@ -87,13 +93,5 @@ void Scan (AndroidTargetArch targetArch, TypeDefinition type, HashSet<string> pi
8793
pinvokeCache.Add (key);
8894
pinvokes.Add (pinfo);
8995
}
90-
91-
if (!type.HasNestedTypes) {
92-
return;
93-
}
94-
95-
foreach (TypeDefinition nestedType in type.NestedTypes) {
96-
Scan (targetArch, nestedType, pinvokeCache, pinvokes);
97-
}
9896
}
9997
}

0 commit comments

Comments
 (0)