Browse Source

Fixed the generated C# for templated indexers specialised with enums.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1033/head
Dimitar Dobrev 8 years ago
parent
commit
0ea147b1e3
  1. 2
      src/AST/TypeExtensions.cs
  2. 12
      tests/CSharp/CSharpTemplates.h

2
src/AST/TypeExtensions.cs

@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
public static bool IsEnumType(this Type t)
{
var tag = t as TagType;
var tag = t.Desugar() as TagType;
if (tag == null)
return false;

12
tests/CSharp/CSharpTemplates.h

@ -523,6 +523,12 @@ DependentValueFields<OnlySpecialisedInTypeArg<T>> OnlySpecialisedInTypeArg<T>::r @@ -523,6 +523,12 @@ DependentValueFields<OnlySpecialisedInTypeArg<T>> OnlySpecialisedInTypeArg<T>::r
{
}
enum class UsedInTemplatedIndexer
{
Item1,
Item2
};
// 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,
@ -530,8 +536,9 @@ void forceUseSpecializations(IndependentFields<int> _1, IndependentFields<bool> @@ -530,8 +536,9 @@ void forceUseSpecializations(IndependentFields<int> _1, IndependentFields<bool>
VirtualTemplate<int> _6, VirtualTemplate<bool> _7,
HasDefaultTemplateArgument<int, int> _8, DerivedChangesTypeName<T1> _9,
TemplateWithIndexer<int> _10, TemplateWithIndexer<T1> _11,
TemplateWithIndexer<T2*> _12, TemplateDerivedFromRegularDynamic<RegularDynamic> _13,
IndependentFields<OnlySpecialisedInTypeArg<double>> _14, std::string s);
TemplateWithIndexer<T2*> _12, TemplateWithIndexer<UsedInTemplatedIndexer> _13,
TemplateDerivedFromRegularDynamic<RegularDynamic> _14,
IndependentFields<OnlySpecialisedInTypeArg<double>> _15, std::string s);
void hasIgnoredParam(DependentValueFields<IndependentFields<Ignored>> ii);
@ -551,6 +558,7 @@ template class DLL_API VirtualTemplate<bool>; @@ -551,6 +558,7 @@ template class DLL_API VirtualTemplate<bool>;
template class DLL_API HasDefaultTemplateArgument<int, int>;
template class DLL_API DerivedChangesTypeName<T1>;
template class DLL_API TemplateWithIndexer<int>;
template class DLL_API TemplateWithIndexer<UsedInTemplatedIndexer>;
template class DLL_API TemplateWithIndexer<T1>;
template class DLL_API TemplateWithIndexer<T2*>;
template class DLL_API TemplateDerivedFromRegularDynamic<RegularDynamic>;

Loading…
Cancel
Save