Simple code sample of Nesting Structures. I'm I doing something illegal here?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 22 13:54:01 PST 2014


On Sat, 22 Nov 2014 20:57:05 +0000
WhatMeWorry via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

>          auto bottom = NestedBottom(2, ['d','o','g']);
ah, that good old thingy! there were some debates about locals that
shadows fields and how that can introduce some hard-to-catch bugs.

you were hit by exactly that: you creating local variable `bottom`
instead of assigning value to member `bottom`. that nasty little
compiler is playing tricks with us all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141122/dbb3af37/attachment.sig>


More information about the Digitalmars-d-learn mailing list