eeschema: bus member falls off bus when also individually renamed at a sheet pin

Description

If you send both a bus as well as one of its members to sheet pins, and the parent sheet names the member net something different, the member will be dropped from the bus when the bus gets passed to another sheet.

This is extremely bad. For all intents and purposes, that member should be connected through the bus, but it gets mysteriously dropped due to being used elsewhere.

image

image

Steps to reproduce

  1. bug.zip
  2. Highlight a on test1; notice it makes it to test2
  3. Highlight b on test1; it does not make it to test2
  4. Highlight b on test2; it's a separate net from the b on test1.

KiCad Version

Application: KiCad Schematic Editor x86_64 on x86_64

Version: 8.0.3-97-g006f0a95c1, release build

Libraries:
	wxWidgets 3.2.4
	FreeType 2.11.1
	HarfBuzz 2.7.4
	FontConfig 2.13.1
	libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.17

Platform: Ubuntu 22.04.4 LTS, 64 bit, Little endian, wxGTK, X11, xubuntu, x11
OpenGL: Intel, Mesa Intel(R) Graphics (RPL-P), 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2

Build Info:
	Date: Jun 24 2024 11:45:01
	wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.74.0
	OCC: 7.6.3
	Curl: 7.81.0
	ngspice: 36
	Compiler: GCC 11.4.0 with C++ ABI 1016

Build settings: