Skip to content

Commit

Permalink
Ensured symbols for nested template specialisations.
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Oct 20, 2017
1 parent 2f0294d commit 5e39989
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Generator/AST/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,36 @@ public static bool CheckIgnoreProperty(Property prop)
return !prop.IsGenerated;
}

public static void CheckTypeForSpecialization(Type type, Declaration container,
public static bool CheckTypeForSpecialization(Type type, Declaration container,
Action<ClassTemplateSpecialization> addSpecialization,
ITypeMapDatabase typeMaps, bool internalOnly = false)
{
type = type.Desugar();
type = (type.GetFinalPointee() ?? type).Desugar();
ClassTemplateSpecialization specialization = GetParentSpecialization(type);
if (specialization == null)
return;
return true;

if (IsSpecializationNeeded(container, typeMaps, internalOnly, specialization))
return;
return false;

if (!internalOnly)
{
if (IsSpecializationSelfContained(specialization, container))
return;
return true;

if (IsMappedToPrimitive(typeMaps, type, specialization))
return;
return true;
}

if (specialization.Arguments.Select(
a => a.Type.Type).Any(t => t != null &&
!CheckTypeForSpecialization(t, container, addSpecialization,
typeMaps, internalOnly)))
return false;

addSpecialization(specialization);
return true;
}

public static bool IsTypeExternal(Module module, Type type)
Expand Down

0 comments on commit 5e39989

Please sign in to comment.