> On Apr 17, 2017, at 9:07 AM, Joe Groff via swift-evolution > <[email protected]> wrote: > > >> On Apr 15, 2017, at 9:49 PM, Xiaodi Wu via swift-evolution >> <[email protected]> wrote: >> >> For example, I expect `XCTAssertEqual<T : FloatingPoint>(_:_:)` to be vended >> as part of XCTest, in order to make sure that >> `XCTAssertEqual(resultOfComputation, Double.nan)` always fails. > > Unit tests strike me as an example of where you really *don't* want level 1 > comparison semantics. If I'm testing the output of an FP operation, I want to > be able to test that it produces nan when I expect it to, or that it produces > the right zero.
I find it very concerning that == will have different results based on concrete vs generic type parameters. This can only lead to significant confusion down the road. I’m highly concerned about situations where taking a concrete algorithm and generalizing it (with generics) will change its behavior. -Chris _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
