Skip to content

Specializing a generic parent drops nested generic specializations #73

@Kyle-Ye

Description

@Kyle-Ye

Summary

When both a type A and its nested type A.B are generic, specializing A can cause the specialized entries for A.B to disappear from RuntimeViewer's sidebar/results.

Reproduction

  1. Open RuntimeViewer and inspect SwiftUI/SwiftUICore.
  2. Filter for EventListenerPhase.
  3. Observe that both the parent type and nested types have generic/specialized entries, for example:
    • SwiftUI.EventListenerPhase
    • SwiftUI.EventListenerPhase.Value
    • SwiftUI.EventListenerPhase.Value<SwiftUI.SpatialEvent>
  4. Specialize the parent type, for example SwiftUI.EventListenerPhase<SwiftUI.MouseEvent>.
  5. Re-check the nested generic/specialized entries under SwiftUI.EventListenerPhase.Value.

Actual Behavior

After the parent generic type is specialized, nested generic specialization entries can be removed/hidden from the runtime object tree. In the observed case, specializing EventListenerPhase caused the previously visible specialized nested EventListenerPhase.Value<...> entry to disappear from the expected place.

Expected Behavior

Specializing A should not destroy or hide existing A.B specializations. Nested generic specializations should either remain visible under the nested generic declaration or be re-associated with the specialized parent in a predictable way.

Notes

Observed while inspecting SwiftUI/SwiftUICore on macOS with RuntimeViewer. The visible symptom is in the sidebar tree/search results, but the underlying issue may be in runtime object identity, specialization grouping, or tree diffing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions