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 {
242
242
// / Whether this declaration has an opaque return type.
243
243
unsigned HasOpaqueReturnType : 1 ;
244
244
245
- // / Whether this declaration is 'async'
246
- unsigned HasAsync : 1 ;
247
-
248
245
OverloadSignature ()
249
246
: UnaryOperator(UnaryOperatorKind::None), IsInstanceMember(false ),
250
247
IsVariable (false ), IsFunction(false ), InProtocolExtension(false ),
251
- InExtensionOfGenericType(false ), HasOpaqueReturnType(false ),
252
- HasAsync(false ) {}
248
+ InExtensionOfGenericType(false ), HasOpaqueReturnType(false ) { }
253
249
};
254
250
255
251
// / 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,
2403
2403
(sig2.IsVariable && !sig1.Name .getArgumentNames ().empty ()));
2404
2404
}
2405
2405
2406
- // If one is asynchronous and the other is not, they can't conflict.
2407
- if (sig1.HasAsync != sig2.HasAsync )
2408
- return false ;
2409
-
2410
2406
// Note that we intentionally ignore the HasOpaqueReturnType bit here.
2411
2407
// For declarations that can't be overloaded by type, we want them to be
2412
2408
// considered conflicting independent of their type.
@@ -2630,8 +2626,6 @@ OverloadSignature ValueDecl::getOverloadSignature() const {
2630
2626
signature.IsTypeAlias = isa<TypeAliasDecl>(this );
2631
2627
signature.HasOpaqueReturnType =
2632
2628
!signature.IsVariable && (bool )getOpaqueResultTypeDecl ();
2633
- signature.HasAsync = isa<AbstractFunctionDecl>(this ) &&
2634
- cast<AbstractFunctionDecl>(this )->hasAsync ();
2635
2629
2636
2630
// Unary operators also include prefix/postfix.
2637
2631
if (auto func = dyn_cast<FuncDecl>(this )) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ func testNonConversions() async {
12
12
13
13
// Overloading
14
14
@available ( swift, deprecated: 4.0 , message: " synchronous is no fun " )
15
- func overloadedSame( ) -> String { " synchronous " }
15
+ func overloadedSame( _ : Int = 0 ) -> String { " synchronous " }
16
16
17
17
func overloadedSame( ) async -> String { " asynchronous " }
18
18
Original file line number Diff line number Diff line change 6
6
func redecl1( ) async { } // expected-note{{previously declared here}}
7
7
func redecl1( ) async throws { } // expected-error{{invalid redeclaration of 'redecl1()'}}
8
8
9
+ func redecl2( ) -> String { " " } // expected-note{{previously declared here}}
10
+ func redecl2( ) async -> String { " " } // expected-error{{invalid redeclaration of 'redecl2()'}}
11
+
9
12
// Override checking
10
13
11
14
class Super {
You can’t perform that action at this time.
0 commit comments