Skip to content

[SR-3397] Various Index types should be nested inside their Collection types #45985

@airspeedswift

Description

@airspeedswift
Previous ID SR-3397
Radar rdar://problem/31414906
Original Reporter @airspeedswift
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement, AffectsABI, StarterProposal, swift-evolution-proposal-needed
Assignee None
Priority Medium

md5: 3c83d1b6fbe2723eae39af2904d67ffe

Issue Description:

A number of collections declare a custom index type. Due to historical compiler constraints on nested generics, these are declared outside their collection types. This restriction is now lifted and they should be moved to be nested types.

For example, DictionaryIndex should be Dictionary.Index, and ClosedRangeIndex should be ClosedRange.Index.

For Swift 3 compatibility reasons, deprecated typealiases should be created. Currently, these will not be extensible if anyone is doing this (unlikely but possible), so compiler work to allow this would be required for true backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions