Skip to content

Commit 082899e

Browse files
committed
always order unconstrained extensions before constrained ones
1 parent d4db260 commit 082899e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Sources/UnidocPages/Groups/Inliner.Groups.Genericness.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ extension Inliner.Groups
22
{
33
enum Genericness:Equatable, Hashable, Comparable, Sendable
44
{
5-
case generic
6-
case concrete
5+
/// No generic constraints.
6+
case unconstrained
7+
/// At least one generic constraint, but not enough to fully concretize the extension.
8+
case constrained
9+
/// Enough generic constraints to fully concretize the extension.
10+
case concretized
711
}
812
}

Sources/UnidocPages/Groups/Inliner.Groups.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ extension Inliner.Groups
7777
.third($0.package)
7878
} ?? .first
7979

80-
let genericness:Genericness =
81-
generics.count(substituting: group.conditions) == 0 ? .generic : .concrete
80+
let genericness:Genericness = group.conditions.isEmpty ?
81+
.unconstrained : generics.count(substituting: group.conditions) > 0 ?
82+
.constrained :
83+
.concretized
8284

8385
extensions.append((group, partisanship, genericness))
8486

0 commit comments

Comments
 (0)