The throws(T) syntax restricts a function to throwing a specific concrete error type T, which must conform to the Error protocol. The legacy throws keyword is preserved as syntactic sugar equivalent to throws(any Error), maintaining backward compatibility while allowing for precise error contracts.
A function defined as throws(Never) is semantically identical to a non-throwing function, allowing the compiler to optimize away error handling paths. This unifies the type system, enabling generic algorithms to accept both throwing and non-throwing closures without requiring separate overloads.