Skip to content

Commit 7beff30

Browse files
authored
Merge pull request swiftlang#24771 from jckarter/opaque-underlying-closure-test
Add regression test that opaque underlying type checking does not look in closures
2 parents 331e192 + 1d6aca4 commit 7beff30

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

test/type/opaque.swift

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,6 @@ func associatedTypeIdentity() {
274274
sameType(gary(doug()).r_out(), gary(candace()).r_out()) // expected-error{{}}
275275
}
276276

277-
/* TODO: diagnostics
278-
struct DoesNotConform {}
279-
280-
func doesNotConform() -> some P {
281-
return DoesNotConform()
282-
}
283-
284-
var doesNotConformProp: some P = DoesNotConform()
285-
286-
var DoesNotConformComputedProp: some P {
287-
return DoesNotConform()
288-
}
289-
*/
290-
291277
func redeclaration() -> some P { return 0 } // expected-note{{previously declared}}
292278
func redeclaration() -> some P { return 0 } // expected-error{{redeclaration}}
293279
func redeclaration() -> some Q { return 0 }
@@ -356,3 +342,10 @@ func recursive_func_is_invalid_opaque() {
356342
return rec(x: x - 1)
357343
}
358344
}
345+
346+
func closure() -> some P {
347+
_ = {
348+
return "test"
349+
}
350+
return 42
351+
}

0 commit comments

Comments
 (0)