mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
14 lines
200 B
Swift
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)
|
|
}
|
|
}
|