Repository: carbon-language/carbon-lang
File: toolchain/check/type_structure.cpp (C++)

Code before:
          break;
        }
        case CARBON_KIND(SemIR::FloatType type): {
          (void)type;
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
        case CARBON_KIND(SemIR::GenericClassType type): {
          (void)type;
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
        case CARBON_KIND(SemIR::GenericInterfaceType type): {
          (void)type;
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
        case CARBON_KIND(SemIR::ImplWitnessAccess type): {
          (void)type;
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
        case CARBON_KIND(SemIR::IntType int_type): {
          ++position_;  // Opening of type.
          if (context_.constant_values().Get(inst_id).is_concrete()) {
            structure_.push_back(TypeStructure::Structural::Concrete);
          } else {
            structure_.push_back(TypeStructure::Structural::ConcreteOpenParen);
            Push(CloseType{});
            PushArgs({int_type.bit_width_id});
          }
          break;
        }
        case CARBON_KIND(SemIR::IntLiteralType type): {
          (void)type;
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
        case CARBON_KIND(SemIR::LegacyFloatType type): {
          (void)type;
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
        case CARBON_KIND(SemIR::PointerType type): {
          (void)type;

Review comment (suggestion):
Consider merging these identical cases:
```suggestion
        case SemIR::AssociatedEntityType::Kind:
        case SemIR::BoolType::Kind:
        case SemIR::FloatType::Kind:
        case SemIR::GenericClassType::Kind:
        case SemIR::GenericInterfaceType::Kind:
        case SemIR::ImplWitnessAccess::Kind: {
          ++position_;
          structure_.push_back(TypeStructure::Structural::Concrete);
          break;
        }
```
and similar.

Code after:
        }
        case CARBON_KIND(SemIR::IntType int_type): {
          if (context_.constant_values().Get(inst_id).is_concrete()) {
            AppendStructural(TypeStructure::Structural::Concrete);
          } else {
            AppendStructural(TypeStructure::Structural::ConcreteOpenParen);
            Push(CloseType());
            PushArgs({int_type.bit_width_id});
          }
          break;
        }

          // ==== Aggregate types ====

        case CARBON_KIND(SemIR::ArrayType array_type): {
          AppendStructural(TypeStructure::Structural::ConcreteOpenParen);
          Push(CloseType());
          Push(array_type.element_type_id);
          PushInstId(array_type.bound_id);
          break;
        }
        case CARBON_KIND(SemIR::ClassType class_type): {
          auto args = GetSpecificArgs(class_type.specific_id);
          if (args.empty()) {
            AppendStructural(TypeStructure::Structural::Concrete);
          } else {
            AppendStructural(TypeStructure::Structural::ConcreteOpenParen);
            Push(CloseType());
            PushArgs(args);
          }
          break;
        }
        case CARBON_KIND(SemIR::ConstType const_type): {
          // We don't put the `const` into the type structure since it is a
          // modifier; just move to the inner type.
          Push(const_type.inner_id);
          break;
        }
        case CARBON_KIND(SemIR::PointerType pointer_type): {
          AppendStructural(TypeStructure::Structural::ConcreteOpenParen);
          Push(CloseType());
          Push(pointer_type.pointee_id);
          break;
        }
        case CARBON_KIND(SemIR::TupleType tuple_type): {
          auto inner_types = context_.type_blocks().Get(tuple_type.elements_id);
          if (inner_types.empty()) {
            AppendStructural(TypeStructure::Structural::Concrete);
          } else {
            AppendStructural(TypeStructure::Structural::ConcreteOpenParen);
            Push(CloseType());