mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[stdlib] Resolve the ambiguity for Int32.init(bitPattern:)
When this initializer is invoked with an integer literal, the expression is ambiguous, since both UIn32 and Float are RepresentableByIntegerLiteral. Fixes: https://bugs.swift.org/browse/SR-5176
This commit is contained in:
@@ -79,3 +79,7 @@ func negativeShift(_ u8: UInt8) {
|
||||
_ = (u8 << -1)
|
||||
}
|
||||
#endif
|
||||
|
||||
func sr5176(description: String = "unambiguous Int32.init(bitPattern:)") {
|
||||
_ = Int32(bitPattern: 0) // should compile without ambiguity
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user