Skip to content

Commit 5813096

Browse files
committed
---
yaml --- r: 294898 b: refs/heads/swift-5.1-branch c: 6df9338 h: refs/heads/master
1 parent b4eabd9 commit 5813096

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ refs/heads/marcrasi-astverifier-disable: 3fac766a23a77ebd0640296bfd7fc116ea60a4e
12421242
refs/heads/revert-22227-a-tall-white-fountain-played: adfce60b2eaa54903ea189bed8a783bca609fa53
12431243
refs/heads/revert-22300-revert-22227-a-tall-white-fountain-played: 5f92040224df7dd4e618fdfb367349df64d8acad
12441244
refs/heads/swift-5.1-old-llvm-branch: 9cef8175146f25b72806154b8a0f4a3f52e3e400
1245-
refs/heads/swift-5.1-branch: cf62e6b05d24cffee80a47fe518630f40650cad9
1245+
refs/heads/swift-5.1-branch: 6df93383ae7301008c957a96bd41766ee131dce0
12461246
refs/tags/swift-4.2.2-RELEASE: e429d1f1aaf59e69d38207a96e56265c7f6fccec
12471247
refs/tags/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-02-a: 3e5a03d32ff3b1e9af90d6c1198c14f938379a6e
12481248
refs/tags/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-03-a: 4591c933063ddcb0d6cd6d0cdd01086b2f9b244d
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %target-swift-frontend %s -typecheck -verify
2+
3+
let int: Int = fatalError() // expected-error {{cannot convert value of type 'Never' to specified type 'Int'}}
4+
5+
func explicitReturn() -> Int {
6+
return fatalError() // expected-error {{cannot convert return expression of type 'Never' to return type 'Int'}}
7+
}
8+
9+
func explicitMultiElement() -> Int {
10+
print("no way")
11+
return fatalError() // expected-error {{cannot convert return expression of type 'Never' to return type 'Int'}}
12+
}
13+
14+
func implicitReturn() -> Int {
15+
fatalError()
16+
}
17+

0 commit comments

Comments
 (0)