Skip to content

Commit

Permalink
fix usage of Type.prop in typeof expressions
Browse files Browse the repository at this point in the history
- use Type.init.prop
  • Loading branch information
MartinNowak committed Dec 1, 2013
1 parent 1631288 commit 05fe0ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions std/conv.d
Expand Up @@ -3179,8 +3179,8 @@ Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket
if (isExactSomeString!Source &&
isAssociativeArray!Target && !is(Target == enum))
{
alias KeyType = typeof(Target.keys[0]);
alias ValType = typeof(Target.values[0]);
alias KeyType = typeof(Target.init.keys[0]);
alias ValType = typeof(Target.init.values[0]);

Target result;

Expand Down
4 changes: 2 additions & 2 deletions std/format.d
Expand Up @@ -4395,10 +4395,10 @@ body
}
else static if (isAssociativeArray!T)
{
auto key = unformatElement!(typeof(T.keys[0]))(input, fmt);
auto key = unformatElement!(typeof(T.init.keys[0]))(input, fmt);
fmt.readUpToNextSpec(input); // eat key separator

result[key] = unformatElement!(typeof(T.values[0]))(input, fmt);
result[key] = unformatElement!(typeof(T.init.values[0]))(input, fmt);
}
debug (unformatRange) {
if (input.empty) printf("-> front = [empty] ");
Expand Down
6 changes: 3 additions & 3 deletions std/variant.d
Expand Up @@ -431,7 +431,7 @@ private:
&& allowed!(typeof(A.init.values[0])))
{
auto result = cast(VariantN*) parm;
*result = (*zis)[result.get!(typeof(A.keys[0]))];
*result = (*zis)[result.get!(typeof(A.init.keys[0]))];
break;
}
else
Expand All @@ -452,8 +452,8 @@ private:
else static if (isAssociativeArray!(A))
{
auto args = cast(VariantN*) parm;
(*zis)[args[1].get!(typeof(A.keys[0]))]
= args[0].get!(typeof(A.values[0]));
(*zis)[args[1].get!(typeof(A.init.keys[0]))]
= args[0].get!(typeof(A.init.values[0]));
break;
}
else
Expand Down

0 comments on commit 05fe0ae

Please sign in to comment.