We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff90621 commit e8f5c13Copy full SHA for e8f5c13
source/mongoschema/variant.d
@@ -94,7 +94,7 @@ final struct SchemaVariant(Specs...) if (distinctFieldNames!(Specs))
94
enum hasType = staticIndexOf!(T, Types) != -1;
95
}
96
97
-public @safe:
+public:
98
Algebraic!Types value;
99
100
this(T)(T value) @trusted
@@ -122,9 +122,9 @@ public @safe:
122
if (!value.hasValue)
123
return null;
124
125
- static foreach (T; Types)
126
- if (isType!T)
127
- return T.stringof;
+ static foreach (Field; Fields)
+ if (isType!(Field.Type))
+ return Field.name;
128
129
assert(false, "Checked all possible types of variant but none of them matched?!");
130
0 commit comments