Re: Is this a compiler aliasing bug?

2021-09-22 Thread Chris Katko via Digitalmars-d-learn
On Friday, 17 September 2021 at 10:29:12 UTC, bauss wrote: On Friday, 17 September 2021 at 09:44:53 UTC, Chris Katko wrote: [...] It's not a bug because "obj.x" referes to the same symbol that is "this.x" Alias will create an alias for a symbol, not an expression or the like. So obj.x

Re: Is this a compiler aliasing bug?

2021-09-17 Thread bauss via Digitalmars-d-learn
On Friday, 17 September 2021 at 09:44:53 UTC, Chris Katko wrote: I'm debugging some code I wrote back in 2017 and a bounding box collision detection kept giving spurious answers till I resorted to assuming nothing and dumped every variable and alias. I kept getting results like it was

Re: Is this a compiler aliasing bug?

2021-09-17 Thread ag0aep6g via Digitalmars-d-learn
On 17.09.21 11:44, Chris Katko wrote: bool is_colliding_with(drawable_object_t obj) //was a class member { [...] alias x2 = obj.x; alias y2 = obj.y; alias w2 = obj.w; alias h2 = obj.h; [...]     } Those aliases don't work like you want them to. You can't have