Skip to content

Commit 1648bec

Browse files
authored
Merge pull request #5620 from rudkx/rdar27391581-add-test
2 parents 4c96f64 + 5701d50 commit 1648bec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/Constraints/diagnostics.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,11 @@ extension Foo23752537 {
737737
}
738738
}
739739

740+
// <rdar://problem/27391581> QoI: Nonsensical "binary operator '&&' cannot be applied to two 'Bool' operands"
741+
func rdar27391581(_ a : Int, b : Int) -> Int {
742+
return a == b && b != 0
743+
// expected-error @-1 {{cannot convert return expression of type 'Bool' to return type 'Int'}}
744+
}
740745

741746
// <rdar://problem/22276040> QoI: not great error message with "withUnsafePointer" sametype constraints
742747
func read2(_ p: UnsafeMutableRawPointer, maxLength: Int) {}

0 commit comments

Comments
 (0)