File tree Expand file tree Collapse file tree 4 files changed +5
-12
lines changed
Expand file tree Collapse file tree 4 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -242,14 +242,10 @@ struct OverloadSignature {
242242 // / Whether this declaration has an opaque return type.
243243 unsigned HasOpaqueReturnType : 1 ;
244244
245- // / Whether this declaration is 'async'
246- unsigned HasAsync : 1 ;
247-
248245 OverloadSignature ()
249246 : UnaryOperator(UnaryOperatorKind::None), IsInstanceMember(false ),
250247 IsVariable (false ), IsFunction(false ), InProtocolExtension(false ),
251- InExtensionOfGenericType(false ), HasOpaqueReturnType(false ),
252- HasAsync(false ) {}
248+ InExtensionOfGenericType(false ), HasOpaqueReturnType(false ) { }
253249};
254250
255251// / Determine whether two overload signatures conflict.
Original file line number Diff line number Diff line change @@ -2403,10 +2403,6 @@ bool swift::conflicting(const OverloadSignature& sig1,
24032403 (sig2.IsVariable && !sig1.Name .getArgumentNames ().empty ()));
24042404 }
24052405
2406- // If one is asynchronous and the other is not, they can't conflict.
2407- if (sig1.HasAsync != sig2.HasAsync )
2408- return false ;
2409-
24102406 // Note that we intentionally ignore the HasOpaqueReturnType bit here.
24112407 // For declarations that can't be overloaded by type, we want them to be
24122408 // considered conflicting independent of their type.
@@ -2630,8 +2626,6 @@ OverloadSignature ValueDecl::getOverloadSignature() const {
26302626 signature.IsTypeAlias = isa<TypeAliasDecl>(this );
26312627 signature.HasOpaqueReturnType =
26322628 !signature.IsVariable && (bool )getOpaqueResultTypeDecl ();
2633- signature.HasAsync = isa<AbstractFunctionDecl>(this ) &&
2634- cast<AbstractFunctionDecl>(this )->hasAsync ();
26352629
26362630 // Unary operators also include prefix/postfix.
26372631 if (auto func = dyn_cast<FuncDecl>(this )) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ func testNonConversions() async {
1212
1313// Overloading
1414@available ( swift, deprecated: 4.0 , message: " synchronous is no fun " )
15- func overloadedSame( ) -> String { " synchronous " }
15+ func overloadedSame( _ : Int = 0 ) -> String { " synchronous " }
1616
1717func overloadedSame( ) async -> String { " asynchronous " }
1818
Original file line number Diff line number Diff line change 66func redecl1( ) async { } // expected-note{{previously declared here}}
77func redecl1( ) async throws { } // expected-error{{invalid redeclaration of 'redecl1()'}}
88
9+ func redecl2( ) -> String { " " } // expected-note{{previously declared here}}
10+ func redecl2( ) async -> String { " " } // expected-error{{invalid redeclaration of 'redecl2()'}}
11+
912// Override checking
1013
1114class Super {
You can’t perform that action at this time.
0 commit comments