mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
8 lines
412 B
Swift
8 lines
412 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 3
|
|
// RUN: %target-typecheck-verify-swift -swift-version 4
|
|
|
|
func signedBitPattern() {
|
|
_ = Int64(bitPattern: 0.0) // expected-error {{Please use Int64(bitPattern: UInt64) in combination with Double.bitPattern property.}}
|
|
_ = Int32(bitPattern: 0.0) // expected-error {{Please use Int32(bitPattern: UInt32) in combination with Float.bitPattern property.}}
|
|
}
|