Skip to content

Commit 39d5828

Browse files
committed
Fix a regression with headers named after keywords
Fixes #1212. Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent a9bfe1c commit 39d5828

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Generator/Generators/CSharp/CSharpSources.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public virtual void GenerateNamespaceFunctionsAndVariables(DeclarationContext co
244244
return;
245245

246246
PushBlock(BlockKind.Functions);
247-
var parentName = context.TranslationUnit.FileNameWithoutExtension;
247+
var parentName = SafeIdentifier(context.TranslationUnit.FileNameWithoutExtension);
248248

249249
var keyword = "class";
250250
var classes = EnumerateClasses().ToList();
@@ -740,10 +740,9 @@ public override void GenerateClassSpecifier(Class @class)
740740
}
741741
}
742742

743-
if (@class.IsGenerated && isBindingGen)
743+
if (@class.IsGenerated && isBindingGen && @class.IsRefType && !@class.IsOpaque)
744744
{
745-
if (@class.IsRefType && !@class.IsOpaque)
746-
bases.Add("IDisposable");
745+
bases.Add("IDisposable");
747746
}
748747

749748
if (bases.Count > 0 && !@class.IsStatic)

tests/Common/interface.h

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void Func();

0 commit comments

Comments
 (0)