mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Prevent import of template arguments that are not types
This commit is contained in:
parent
7ccd05f1d4
commit
bf77c95a0d
|
@ -12,7 +12,7 @@
|
||||||
module poodinis.imports;
|
module poodinis.imports;
|
||||||
|
|
||||||
import std.meta : staticIndexOf;
|
import std.meta : staticIndexOf;
|
||||||
import std.traits : moduleName, TemplateArgsOf, isBuiltinType;
|
import std.traits : moduleName, TemplateArgsOf, isBuiltinType, isType;
|
||||||
|
|
||||||
public static string createImportsString(Type, ParentTypeList...)()
|
public static string createImportsString(Type, ParentTypeList...)()
|
||||||
{
|
{
|
||||||
|
@ -21,8 +21,8 @@ public static string createImportsString(Type, ParentTypeList...)()
|
||||||
{
|
{
|
||||||
foreach (TemplateArgType; TemplateArgsOf!Type)
|
foreach (TemplateArgType; TemplateArgsOf!Type)
|
||||||
{
|
{
|
||||||
static if (!isBuiltinType!TemplateArgType
|
static if (isType!TemplateArgType &&
|
||||||
&& staticIndexOf!(TemplateArgType, ParentTypeList) == -1)
|
(!isBuiltinType!TemplateArgType && staticIndexOf!(TemplateArgType, ParentTypeList) == -1))
|
||||||
{
|
{
|
||||||
imports ~= createImportsString!(TemplateArgType, ParentTypeList, Type);
|
imports ~= createImportsString!(TemplateArgType, ParentTypeList, Type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue