Files
swift-mirror/test/Constraints/rdar145092838.swift
Slava Pestov 521ea46d15 Sema: Don't record constraints containing UnboundGenericType from shrink()
Something changed here between the removal of shrink() and it's
re-introduction, and we now record constraints that contain
UnboundGenericType, which crashes in matchTypes().

As a narrow workaround, let's just ignore the contextual type if
contains an UnboundGenericType.

Fixes rdar://145092838.
2025-02-19 13:27:33 -05:00

6 lines
131 B
Swift

// RUN: %target-typecheck-verify-swift
func f(a: Array<Int>, n: Int) {
let _: Array = a.prefix(n) + a.suffix(a.count - n - 1)
}