Skip to content

Reinstate diagnostics for assignment from Int to unsigned types. #8756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions validation-test/stdlib/FixedPointDiagnostics.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// RUN: %line-directive %t/main.swift -- %target-swift-frontend -typecheck -verify %t/main.swift

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

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

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

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

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