Skip to content

Commit 03f7f62

Browse files
committed
Fix Delegates namespace being not generated.
In some cases `Delegates` namespace could be attached to a namespace which is not wrapped and as a result of that `Delegates` namespace was also not generated in wrapper code resulting in a wrapper build errors. Change adds extra logic which tries to find the correct library namespace if more than one namespace is present.
1 parent 555c515 commit 03f7f62

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Generator/Passes/DelegatesPass.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ private DeclarationContext GetDeclContextForDelegates(DeclarationContext @namesp
187187
).GroupBy(d => d.Name).Where(g => g.Any(d => d.HasDeclarations)).ToList();
188188
if (groups.Count == 1)
189189
parent = groups.Last().Last();
190+
else
191+
{
192+
foreach (var g in groups)
193+
{
194+
parent = g.ToList().Find(ns => ns.Name == module.LibraryName || ns.Name == module.OutputNamespace);
195+
if (parent != null)
196+
break;
197+
}
198+
}
190199
}
191200

192201
if (parent == null)

0 commit comments

Comments
 (0)