Browse Source

Fixed the generated C# when a template returns a specialisation with itself as a type arg.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1026/head
Dimitar Dobrev 8 years ago
parent
commit
10607164ed
  1. 2
      src/Generator/AST/Utils.cs
  2. 7
      tests/CSharp/CSharpTemplates.h

2
src/Generator/AST/Utils.cs

@ -108,7 +108,7 @@ namespace CppSharp.AST @@ -108,7 +108,7 @@ namespace CppSharp.AST
if (specialization.Arguments.Select(
a => a.Type.Type).Any(t => t != null &&
!CheckTypeForSpecialization(t, container, addSpecialization,
!CheckTypeForSpecialization(t, specialization, addSpecialization,
typeMaps, internalOnly)))
return false;

7
tests/CSharp/CSharpTemplates.h

@ -514,8 +514,15 @@ TemplateDerivedFromRegularDynamic<T>::~TemplateDerivedFromRegularDynamic() @@ -514,8 +514,15 @@ TemplateDerivedFromRegularDynamic<T>::~TemplateDerivedFromRegularDynamic()
template <typename T>
class OnlySpecialisedInTypeArg
{
public:
DependentValueFields<OnlySpecialisedInTypeArg<T>> returnSelfSpecialization();
};
template <typename T>
DependentValueFields<OnlySpecialisedInTypeArg<T>> OnlySpecialisedInTypeArg<T>::returnSelfSpecialization()
{
}
// we optimise specialisations so that only actually used ones are wrapped
void forceUseSpecializations(IndependentFields<int> _1, IndependentFields<bool> _2,
IndependentFields<T1> _3, IndependentFields<std::string> _4,

Loading…
Cancel
Save