You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/type/opaque.swift
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -172,8 +172,10 @@ func recursion(x: Int) -> some P {
172
172
returnrecursion(x: x -1)
173
173
}
174
174
175
-
func noReturnStmts()->someP{ // expected-note {{opaque return type declared here}}
176
-
fatalError() // expected-error{{return type of global function 'noReturnStmts()' requires that 'Never' conform to 'P'}}
175
+
func noReturnStmts()->someP{} // expected-error {{function declares an opaque return type, but has no return statements in its body from which to infer an underlying type}}
176
+
177
+
func returnUninhabited()->someP{ // expected-note {{opaque return type declared here}}
178
+
fatalError() // expected-error{{return type of global function 'returnUninhabited()' requires that 'Never' conform to 'P'}}
177
179
}
178
180
179
181
func mismatchedReturnTypes(_ x:Bool, _ y:Int, _ z:String)->someP{ // expected-error{{do not have matching underlying types}}
0 commit comments