Skip to content

Commit f256410

Browse files
committed
Reinstate diagnostics for assignment from Int to unsigned types.
These had previously been removed in 9c2bc50 because of differences in the diagnostics being emitted across different platforms. It looks like we're always emitting the same diagnostic now, so restore a specific message. Resolves: rdar://problem/19677545
1 parent 1e822d8 commit f256410

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

validation-test/stdlib/FixedPointDiagnostics.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// RUN: %line-directive %t/main.swift -- %target-swift-frontend -typecheck -verify %t/main.swift
33

44
func testUnaryMinusInUnsigned() {
5-
var a: UInt8 = -(1) // expected-error {{}} expected-note * {{}} expected-warning * {{}}
5+
var a: UInt8 = -(1) // expected-error {{cannot convert value of type 'Int' to specified type 'UInt8'}} expected-note * {{}} expected-warning * {{}}
66

7-
var b: UInt16 = -(1) // expected-error {{}} expected-note * {{}} expected-warning * {{}}
7+
var b: UInt16 = -(1) // expected-error {{cannot convert value of type 'Int' to specified type 'UInt16'}} expected-note * {{}} expected-warning * {{}}
88

9-
var c: UInt32 = -(1) // expected-error {{}} expected-note * {{}} expected-warning * {{}}
9+
var c: UInt32 = -(1) // expected-error {{cannot convert value of type 'Int' to specified type 'UInt32'}} expected-note * {{}} expected-warning * {{}}
1010

11-
var d: UInt64 = -(1) // expected-error {{}} expected-note * {{}} expected-warning * {{}}
11+
var d: UInt64 = -(1) // expected-error {{cannot convert value of type 'Int' to specified type 'UInt64'}} expected-note * {{}} expected-warning * {{}}
1212
}
1313

1414
// Int and UInt are not identical to any fixed-size integer type

0 commit comments

Comments
 (0)