scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.52k stars 345 forks source link

Clever "if let" assignment breaks in Swift 5.6.1 on Linux #259

Closed OurBigAdventure closed 2 months ago

OurBigAdventure commented 9 months ago

This clever little if statement in Cleaner.swift line 36:

if let headWhitelist, let dirtHead = dirtyDocument.head(), let cleanHead = clean.head() {

specifically changing it to:

if let headWhitelist = headWhitelist, let dirtHead = dirtyDocument.head(), let cleanHead = clean.head() {

would solve the issue.

Aloisius commented 9 months ago

For reference, the if let x {} shorthand for shadowing an optional was introduced in Swift 5.7.

Either the README need to be updated to note Swift 5.7 is required or this fixed.