Closed firelizzard18 closed 3 months ago
My use case is the original ask in #1465 - accessing map elements (e.g. a watch expression in vscode). I'm not sure how much value there is in map and slice literals (since those can't me map keys). The map literals my code makes are at least somewhat broken - they can't be iterated since Variable.Addr
is zero. I'm not sure how much else is broken.
I assume it's the Variable construction in (*EvalScope).evalCompositeLit
that's broken? Should I close this PR?
Basically, you are creating a Variable that can only be used in very specific expressions. As I said, there isn't a really way to make this work properly, at the moment. Sorry.
As I said, there isn't a really way to make this work properly, at the moment.
Sure, I get that and I'm not surprised my 'solution' doesn't work. I'm not clear on what you'd prefer to do with this PR: close it or leave it open/as a draft until it can be done properly. It doesn't make much of a difference to me either way.
You should close it, I already have a version privately that does this with the allocation and it's very different from this.
This change implements composite literals for struct, slice, array, and map types.
Fixes #1465