Skip to content

Commit 5e39989

Browse files
committed
Ensured symbols for nested template specialisations.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 2f0294d commit 5e39989

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Generator/AST/Utils.cs

+12-5
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,36 @@ public static bool CheckIgnoreProperty(Property prop)
8484
return !prop.IsGenerated;
8585
}
8686

87-
public static void CheckTypeForSpecialization(Type type, Declaration container,
87+
public static bool CheckTypeForSpecialization(Type type, Declaration container,
8888
Action<ClassTemplateSpecialization> addSpecialization,
8989
ITypeMapDatabase typeMaps, bool internalOnly = false)
9090
{
9191
type = type.Desugar();
9292
type = (type.GetFinalPointee() ?? type).Desugar();
9393
ClassTemplateSpecialization specialization = GetParentSpecialization(type);
9494
if (specialization == null)
95-
return;
95+
return true;
9696

9797
if (IsSpecializationNeeded(container, typeMaps, internalOnly, specialization))
98-
return;
98+
return false;
9999

100100
if (!internalOnly)
101101
{
102102
if (IsSpecializationSelfContained(specialization, container))
103-
return;
103+
return true;
104104

105105
if (IsMappedToPrimitive(typeMaps, type, specialization))
106-
return;
106+
return true;
107107
}
108108

109+
if (specialization.Arguments.Select(
110+
a => a.Type.Type).Any(t => t != null &&
111+
!CheckTypeForSpecialization(t, container, addSpecialization,
112+
typeMaps, internalOnly)))
113+
return false;
114+
109115
addSpecialization(specialization);
116+
return true;
110117
}
111118

112119
public static bool IsTypeExternal(Module module, Type type)

0 commit comments

Comments
 (0)