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
+23-15Lines changed: 23 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -223,8 +223,9 @@ func recursion(x: Int) -> some P {
223
223
224
224
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}} {{educational-notes=opaque-type-inference}}
225
225
226
-
func returnUninhabited()->someP{ // expected-note {{opaque return type declared here}}
227
-
fatalError() // expected-error{{return type of global function 'returnUninhabited()' requires that 'Never' conform to 'P'}}
226
+
// FIXME [OPAQUE SUPPORT]: regression in error message clarity
// expected-error@-1 {{return type of global function 'global_function_with_requirement_failure()' requires that 'Double' conform to 'P'}}
396
+
// expected-error@-1 {{global function 'global_function_with_requirement_failure()' requires that 'Double' conform to 'P'}}
390
397
}
391
398
392
399
func recursive_func_is_invalid_opaque(){
@@ -430,7 +437,8 @@ protocol P_51641323 {
430
437
431
438
func rdar_51641323(){
432
439
structFoo:P_51641323{
433
-
varfoo:someP_51641323{ // expected-note {{required by opaque return type of property 'foo'}}
440
+
// FIXME [OPAQUE SUPPORT]: regression in error message clarity
441
+
varfoo:someP_51641323{ // expected-note {{required by getter '_' where 'τ_0_0' = '() -> ()'}}
434
442
{} // expected-error {{type '() -> ()' cannot conform to 'P_51641323'}} expected-note {{only concrete types such as structs, enums and classes can conform to protocols}}
0 commit comments