In Swift 6.1, the #expect(throws:) function has three variants that handle error matching.The third variant, which takes a trailing closure, has proven to be problematic and challenging to express concisely.Before Swift 6.1, only the third variant allowed access to the thrown error, requiring type casting.With Swift 6.1, the first two variants return the matched error, simplifying the error handling process.