Bolt 2 will support generic type construction at every level: units, fields, ports, events, delegates, etc. This is part of the underlying effort to ensure type safety everywhere, which has both workflow and memory allocation benefits (due to the avoided boxing).

This change would have a most notable impact on Bolt 1’s confusing handling of collections:

Generic type construction means going from an open-constructed generic type (OCGT, e.g. List<T>) to a closed-constructed generic type (CCGT, e.g. List<int>). This will be done through additional type dropdowns for every generic type parameter (GTP) of the OCGT.

For Fields, Port Definitions, Event Parameter Definitions, the workflow will be:

  1. Choose the OCGT from the type dropdown, which will no longer filter them out
  2. Additional dropdowns labeled for each GTP will be shown below the OCGT dropdown
  3. As long as the GTP are not filled, the type control will return null, which will ensure backward compatibility with the rest of the inspectors, by pretending the type was not even chosen yet.
  4. Choose the GTP from the dropdowns, which will be filtered by the constraints
  5. As soon as all GTP are filled, the type control will return a CCGT by using MakeGenericType, which can then be used by the rest of the inspector to display other fields, e.g. a value field of that type

For Member Units, Delegate Units and Event units, the workflow will be:

  1. Choose the unit option with an underlying OCGT target type from the fuzzy finder, which will no longer filter them out
  2. Additional dropdowns labeled for each GTP will be shown in the Unit Settings Header or in the Unit Inspector
  3. As long as the GTP are not filled, the canDefine property of the unit will return false, ensuring none of its ports try to define as GTP