New hash

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 23 20:49:39 PDT 2012


On Sat, Mar 24, 2012 at 04:21:21AM +0100, Andrej Mitrovic wrote:
> On 3/24/12, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
[...]
> > Another issue:
> >
> > 	AA!(string,int[]) aa;
> > 	auto x = aa.get("abc", []);
> 
> Yeah, templates are unforgiving sometimes.

Well, I wish that compiler magic that does these inferences either
worked better, or were somehow accessible to user code so that I don't
have to keep creating workarounds for it. :-/


> How do you nest your hash type? int[int][int] to AA?
> I've tried: alias AA!(int, AA!(int, int)) Assoc;

That should be correct.


> but then I get:
> 
> newAA.d(461): Error: safe function 'opIndexAssign' cannot call system
> function 'opAssign'
[...]

That's a bug. Lemme take a look and see...

Actually, that's a bug introduced by the AA literal workaround that we
did before (see line 313). It's missing a @trusted tag. Man these things
are fidgety. Fix pushed to github.  :-)


T

-- 
Why are you blatanly misspelling "blatant"? -- Branden Robinson


More information about the Digitalmars-d mailing list