i attempted to build the swift-png package with a nightly Swift 6.0 compiler.
Sources/LZ77/HuffmanCoding/LZ77.HuffmanTree.swift:95:63: error: cannot convert sequence element type '(offset: Int, element: Range<Int>)' to expected type '(Int, Range<Int>)'
93 | var z:Int = 256 // n
94 | // finish validating the tree
95 | for (i, leaves):(Int, Range<Int>) in levels[8 ..< 15].enumerated()
| `- error: cannot convert sequence element type '(offset: Int, element: Range<Int>)' to expected type '(Int, Range<Int>)'
96 | {
it seems it is no longer allowed to ignore tuple labels when binding to an unlabeled tuple. was this by design?
6 Likes
xedin
(Pavel Yaskevich)
2
This is definitely a bug, here is a reduction:
func size(_ levels:[Range<Int>]) {
for (i, leaves):(Int, Range<Int>) in levels[8 ..< 15].enumerated() {
}
}
Looks like the solver bindings a type variable that represents an object type of an optional produced by next() before the wrapped type itself.
7 Likes