File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -3607,6 +3607,14 @@ namespace {
3607
3607
return { true , expr };
3608
3608
}
3609
3609
3610
+ if (auto unresolvedMember = dyn_cast<UnresolvedMemberExpr>(expr)) {
3611
+ associateArgumentLabels (unresolvedMember,
3612
+ { unresolvedMember->getArgumentLabels (),
3613
+ unresolvedMember->hasTrailingClosure () },
3614
+ /* labelsArePermanent=*/ true );
3615
+ return { true , expr };
3616
+ }
3617
+
3610
3618
// FIXME: other expressions have argument labels, but this is an
3611
3619
// optimization, so stage it in later.
3612
3620
return { true , expr };
Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ let arr = [BottleLayout]()
630
630
let layout = BottleLayout ( count: 1 )
631
631
let ix = arr. firstIndex ( of: layout) // expected-error {{argument type 'BottleLayout' does not conform to expected type 'Equatable'}}
632
632
633
- let _: ( ) -> UInt8 = { . init( " a " as Unicode . Scalar ) } // expected-error {{missing argument label 'ascii:' in call }}
633
+ let _: ( ) -> UInt8 = { . init( " a " as Unicode . Scalar ) } // expected-error {{initializer 'init(_:)' requires that 'Unicode.Scalar' conform to 'BinaryInteger' }}
634
634
635
635
// https://bugs.swift.org/browse/SR-9068
636
636
func compare< C: Collection , Key: Hashable , Value: Equatable > ( c: C )
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ struct X {
19
19
subscript( _: Int ) -> Int { return 0 }
20
20
subscript( _: Int , _: Int ) -> Double { return 0 }
21
21
subscript( _: Int , _: Int , _: Int ) -> String { return " " }
22
+
23
+ init ( _: Int ) { }
24
+ init ( _: Int , _: Int ) { }
25
+ init ( _: Int , _: Int , _: Int ) { }
22
26
}
23
27
24
28
func testSubscript( x: X , i: Int ) {
@@ -28,3 +32,10 @@ func testSubscript(x: X, i: Int) {
28
32
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.subscript(_:_:)
29
33
_ = x [ i, i]
30
34
}
35
+
36
+ func testUnresolvedMember( i: Int ) -> X {
37
+ // CHECK: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:)
38
+ // CHECK-NEXT: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:_:)
39
+ // CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:)
40
+ return . init( i, i)
41
+ }
Original file line number Diff line number Diff line change @@ -291,7 +291,9 @@ switch staticMembers {
291
291
case . init( 0 ) : break
292
292
case . init( _) : break // expected-error{{'_' can only appear in a pattern}}
293
293
case . init( let x) : break // expected-error{{cannot appear in an expression}}
294
- case . init( opt: 0 ) : break // expected-error{{pattern cannot match values of type 'StaticMembers'}}
294
+ case . init( opt: 0 ) : break // expected-error{{value of optional type 'StaticMembers?' must be unwrapped to a value of type 'StaticMembers'}}
295
+ // expected-note@-1{{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
296
+ // expected-note@-2{{coalesce using '??' to provide a default when the optional value contains 'nil'}}
295
297
296
298
case . prop: break
297
299
// TODO: repeated error message
You can’t perform that action at this time.
0 commit comments