Skip to content

Commit

Permalink
Fix a regression with headers named after keywords
Browse files Browse the repository at this point in the history
Fixes #1212.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information
ddobrev committed Apr 28, 2019
1 parent a9bfe1c commit 39d5828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Generator/Generators/CSharp/CSharpSources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public virtual void GenerateNamespaceFunctionsAndVariables(DeclarationContext co
return;

PushBlock(BlockKind.Functions);
var parentName = context.TranslationUnit.FileNameWithoutExtension;
var parentName = SafeIdentifier(context.TranslationUnit.FileNameWithoutExtension);

var keyword = "class";
var classes = EnumerateClasses().ToList();
Expand Down Expand Up @@ -740,10 +740,9 @@ public override void GenerateClassSpecifier(Class @class)
}
}

if (@class.IsGenerated && isBindingGen)
if (@class.IsGenerated && isBindingGen && @class.IsRefType && !@class.IsOpaque)
{
if (@class.IsRefType && !@class.IsOpaque)
bases.Add("IDisposable");
bases.Add("IDisposable");
}

if (bases.Count > 0 && !@class.IsStatic)
Expand Down
1 change: 1 addition & 0 deletions tests/Common/interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void Func();

0 comments on commit 39d5828

Please sign in to comment.