Browse Source

Fixed the generated C# when a ref parameter is named after a keyword.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1169/head
Dimitar Dobrev 6 years ago
parent
commit
980f36735c
  1. 6
      src/Generator/Generator.cs
  2. 2
      tests/Common/Common.cpp
  3. 2
      tests/Common/Common.h

6
src/Generator/Generator.cs

@ -143,10 +143,8 @@ namespace CppSharp.Generators @@ -143,10 +143,8 @@ namespace CppSharp.Generators
protected abstract string TypePrinterDelegate(CppSharp.AST.Type type);
public static string GeneratedIdentifier(string id)
{
return "__" + id;
}
public static string GeneratedIdentifier(string id) =>
$"__{(id.StartsWith("@") ? id.Substring(1) : id)}";
public void Dispose()
{

2
tests/Common/Common.cpp

@ -848,7 +848,7 @@ HasOverloadsWithDifferentPointerKindsToSameType::~HasOverloadsWithDifferentPoint @@ -848,7 +848,7 @@ HasOverloadsWithDifferentPointerKindsToSameType::~HasOverloadsWithDifferentPoint
{
}
void HasOverloadsWithDifferentPointerKindsToSameType::overload(int& i)
void HasOverloadsWithDifferentPointerKindsToSameType::overload(int& in)
{
}

2
tests/Common/Common.h

@ -1310,7 +1310,7 @@ class DLL_API HasOverloadsWithDifferentPointerKindsToSameType @@ -1310,7 +1310,7 @@ class DLL_API HasOverloadsWithDifferentPointerKindsToSameType
public:
HasOverloadsWithDifferentPointerKindsToSameType();
~HasOverloadsWithDifferentPointerKindsToSameType();
void overload(int& i);
void overload(int& in);
void overload(int&& i);
void overload(const int& i);
void overload(const Foo& rx, int from = -1);

Loading…
Cancel
Save