File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2241,10 +2241,16 @@ FunctionType::ExtInfo ConstraintSystem::closureEffects(ClosureExpr *expr) {
2241
2241
// of is-patterns applied to an irrefutable pattern.
2242
2242
pattern = pattern->getSemanticsProvidingPattern ();
2243
2243
while (auto isp = dyn_cast<IsPattern>(pattern)) {
2244
- const Type castType = TypeResolution::forContextual (
2245
- CS.DC , TypeResolverContext::InExpression,
2246
- /* unboundTyOpener*/ nullptr )
2247
- .resolveType (isp->getCastTypeRepr ());
2244
+ Type castType;
2245
+ if (auto castTypeRepr = isp->getCastTypeRepr ()) {
2246
+ castType = TypeResolution::forContextual (
2247
+ CS.DC , TypeResolverContext::InExpression,
2248
+ /* unboundTyOpener*/ nullptr )
2249
+ .resolveType (castTypeRepr);
2250
+ } else {
2251
+ castType = isp->getCastType ();
2252
+ }
2253
+
2248
2254
if (castType->hasError ()) {
2249
2255
return false ;
2250
2256
}
Original file line number Diff line number Diff line change 2
2
3
3
// Redeclaration checking
4
4
func redecl1( ) async { } // expected-note{{previously declared here}}
5
- func redecl1( ) throws { } // expected-error{{invalid redeclaration of 'redecl1()'}}
5
+ func redecl1( ) async throws { } // expected-error{{invalid redeclaration of 'redecl1()'}}
6
6
7
7
// Override checking
8
8
You can’t perform that action at this time.
0 commit comments