Files
swift-mirror/test/Constraints/rdar143340082.swift
Slava Pestov 881c4f775b Sema: Ignore inactive type variables in addTypeVariableConstraintsToWorkList()
Fixes a regression from commit 0c128e5db7.

The old depthFirstSearch() walked all adjacencies via the constraint graph,
and thus it would visit type variables that are currently inactive because
we're solving a conjunction element.

This was inconsistent with the new union-find which only formed the
connected components from the currently active type variables; adjacencies
involving inactive type variables are no longer considered.

Fix the inconsistency by changing gatherConstraints(), which used from
addTypeVariableConstraintsToWorkList(), to also skip inactive type
variables.

Fixes rdar://problem/143340082.
2025-01-27 10:26:59 -05:00

14 lines
200 B
Swift

// RUN: %target-typecheck-verify-swift
struct Test {
var v: String
var i: Int
}
do {
let _ = Array(1 ... 20).map { i in
_ = 0
return Test(v: "\(i * 1000)", i: 1)
}
}