▲ | NooneAtAll3 4 days ago | |
> Even more, imagine in the future authors of `somepackage` decided to add URL to their struct and it suddendly started to break your code from being compiled. doesn't this just shove the problem down a level? e.g. if somepackage.Bar suddenly gets a member with same name as one of your URL members? | ||
▲ | zimpenfish 3 days ago | parent [-] | |
> e.g. if somepackage.Bar suddenly gets a member with same name as one of your URL members? I think nothing happens there. Your fields "win" on depth and you'd have to access their field with `thing.Bar.Conflicted` (whereas yours would be `thing.Conflicted`). It could only be a problem if someone embeds both `somepackage.Bar` and `mypackage.Cheese` into `T` with a shared field `X` but then you can't access `T.X` without a runtime error of "ambiguous selector". |