Nets with net class directives can forget what net class they belong to
Description
Nets with net class directives seem to revert to the default net class when modifications are made to the schematic that don't involve a net with a net class directive (although the conditions for causing the problem are probably not so simple). The expected behavior is that they would keep the net class specified by the net class directive.
I suspect this is related to #17387 (closed).
Steps to reproduce
- Load the attached project's schematic. Observe that all nets have the correct net class.
- Add a component or wire to the schematic which is connected to neither of the nets in the schematic.
- Select a net with a non-default net class. Observe that it has the default net class.
kicad_netclass_bug.kicad_sch kicad_netclass_bug.kicad_pro kicad_netclass_bug.kicad_prl kicad_netclass_bug.kicad_pcb
KiCad Version
Application: KiCad x86_64 on x86_64
Version: 8.0.1-unknown-202404090134~f1d687cfdb~ubuntu23.10.1, release build
Libraries:
wxWidgets 3.2.2
FreeType 2.13.1
HarfBuzz 8.0.1
FontConfig 2.14.2
libcurl/8.2.1 OpenSSL/3.0.10 zlib/1.2.13 brotli/1.0.9 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.3) libssh/0.10.5/openssl/zlib nghttp2/1.55.1 librtmp/2.3 OpenLDAP/2.6.6
Platform: Ubuntu 23.10, 64 bit, Little endian, wxGTK, X11, ubuntu, x11
Build Info:
Date: Apr 9 2024 01:34:39
wxWidgets: 3.2.2 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.6.3
Curl: 8.2.1
ngspice: 42
Compiler: GCC 13.2.0 with C++ ABI 1018
Build settings:
I observed similar behavior on the latest version (8.0.1) from the releases PPA.