Skip to content

Commit ec6a874

Browse files
committed
[TypeChecker] NFC: Update test-cases improved by new missing arguments diagnostic
1 parent 48520f7 commit ec6a874

19 files changed

+57
-50
lines changed

test/APINotes/versioned-objc.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ extension PrintingInterference {
166166
func testDroppingRenamedPrints() {
167167
// CHECK-DIAGS-4: [[@LINE+1]]:{{[0-9]+}}: warning: use of 'print' treated as a reference to instance method
168168
print(self)
169-
// CHECK-DIAGS-5: [[@LINE-1]]:{{[0-9]+}}: error: use of 'print' nearly matches global function 'print(_:separator:terminator:)' in module 'Swift' rather than instance method 'print(_:extra:)'
169+
// CHECK-DIAGS-5: [[@LINE-1]]:{{[0-9]+}}: error: missing argument for parameter 'extra' in call
170170

171171
// CHECK-DIAGS-4-NOT: [[@LINE+1]]:{{[0-9]+}}:
172172
print(self, extra: self)

test/ClangImporter/foreign_errors.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ func testBlockFinal() throws {
7777
#if !EMIT_SIL
7878
func testNonBlockFinal() throws {
7979
ErrorProne.runWithError(count: 0) // expected-error {{missing argument for parameter #1 in call}}
80-
// TODO(diagnostics): For situations where both label and type where incorrect, we should produce a single error
81-
// which would say something like `cannot invoke 'bar' with argument list (count: Int)`.
82-
ErrorProne.run(count: 0) // expected-error {{incorrect argument label in call (have 'count:', expected 'callback:')}}
83-
// expected-error@-1 {{cannot convert value of type 'Int' to expected argument type '(() -> Void)?'}}
80+
ErrorProne.run(count: 0) // expected-error {{missing argument for parameter 'withAnError' in call}} {{18-18=withAnError: <#AutoreleasingUnsafeMutablePointer<NSError?>?#>, }}
8481
}
8582
#endif
8683

test/Constraints/casts.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,8 @@ func rdar29894174(v: B?) {
215215
// we would fail to produce a diagnostic.
216216
func process(p: Any?) {
217217
compare(p is String)
218-
// expected-error@-1 {{cannot invoke 'compare' with an argument list of type '(Bool)'}}
219-
// expected-note@-2 {{overloads for 'compare' exist with these partially matching parameter lists: (T, T), (T?, T?)}}
218+
// expected-error@-1 {{missing argument for parameter #2 in call}} {{22-22=, <#Bool#>}}
220219
}
221220

222-
func compare<T>(_: T, _: T) {}
221+
func compare<T>(_: T, _: T) {} // expected-note {{'compare' declared here}}
223222
func compare<T>(_: T?, _: T?) {}

test/Constraints/diag_missing_arg.swift

+22-17
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ func attributedInOutFunc(x: inout @convention(c) () -> Int32) {} // expected-not
1919
attributedInOutFunc() // expected-error {{missing argument for parameter 'x' in call}} {{21-21=x: &<#@convention(c) () -> Int32#>}}
2020

2121
func genericFunc1<T>(x: T) {} // expected-note * {{here}}
22-
genericFunc1() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#T#>}}
22+
genericFunc1() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#Any#>}}
2323

2424
protocol P {}
2525
func genericFunc2<T : P>(x: T) {} // expected-note * {{here}}
26-
genericFunc2() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#T#>}}
26+
genericFunc2() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#Any#>}}
2727

2828
typealias MyInt = Int
2929
func aliasedFunc(x: MyInt) {} // expected-note * {{here}}
@@ -61,11 +61,10 @@ param2FuncNonNamed2("foo") // expected-error {{missing argument for parameter 'x
6161

6262
func param2FuncNonNamed3(_ x: Int, _ y: String) {} // expected-note * {{here}}
6363
param2FuncNonNamed3(1) // expected-error {{missing argument for parameter #2 in call}} {{22-22=, <#String#>}}
64-
param2FuncNonNamed3("foo") // expected-error {{missing argument for parameter #2 in call}} {{26-26=, <#String#>}}
65-
// FIXME: Bad diagnostic. Could this be #1?
64+
param2FuncNonNamed3("foo") // expected-error {{missing argument for parameter #1 in call}} {{21-21=<#Int#>, }}
6665

6766
func unlabeledParamFollowingVariadic(_: Any..., _: Any, _: Any) {} // expected-error {{a parameter following a variadic parameter requires a label}}; // expected-note {{here}}
68-
unlabeledParamFollowingVariadic(1, 1, 1) // expected-error {{missing argument for parameter #2 in call}} {{40-40=, <#Any#>}}
67+
unlabeledParamFollowingVariadic(1, 1, 1) // expected-error {{missing arguments for parameters #2, #3 in call}}
6968

7069
func labeledParamFollowingVariadic(_: Any..., label: Any, _: Any) {}
7170
labeledParamFollowingVariadic(1, label: 1, 1)
@@ -97,55 +96,61 @@ _ = s1[x: 1, y: {1}] // Ok.
9796
_ = s1[x: 1] { 1 } // Ok.
9897
_ = s1[x: 1] // expected-error {{missing argument for parameter 'y' in call}} {{12-12=, y: <#() -> Int#>}}
9998
_ = s1[y: { 1 }] // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>, }}
100-
_ = s1[] { 1 } // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(x: Int, y: () -> Int)'}} {{none}}
99+
_ = s1[] { 1 } // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>}}
101100
_ = s1 { 1 } // expected-error {{cannot call value of non-function type 'S1'}} {{none}}
102-
_ = s1[] // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>}}
101+
_ = s1[] // expected-error {{missing arguments for parameters 'x', 'y' in call}} {{8-8=x: <#Int#>, y: <#() -> Int#>}}
103102
s1[x: 1, y: {1}] = 1 // Ok.
104103
s1[x: 1] { 1 } = 1 // Ok.
105104
s1[x: 1] = 1 // expected-error {{missing argument for parameter 'y' in call}} {{8-8=, y: <#() -> Int#>}}
106105
s1[y: { 1 }] = 1 // expected-error {{missing argument for parameter 'x' in call}} {{4-4=x: <#Int#>, }}
107-
s1[] { 1 } = 1 // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(x: Int, y: () -> Int)'}} {{none}}
106+
s1[] { 1 } = 1 // expected-error {{missing argument for parameter 'x' in call}} {{4-4=x: <#Int#>}}
108107

109108
struct S2 {
110109
subscript(x: Int, y: () -> Int) -> Int { get { return 1 } set { } } // expected-note * {{here}}
111110
}
112111
var s2 = S2()
113112
_ = s2[1, {1}] // Ok.
114113
_ = s2[1] { 1 } // Ok.
115-
_ = s2[1] // expected-error {{cannot convert value of type 'Int' to expected argument type '(Int, () -> Int)'}} {{none}}
116-
_ = s2[{ 1 }] // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)'}} {{none}}
117-
_ = s2[] { 1 } // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)'}} {{none}}
114+
_ = s2[1] // expected-error {{missing argument for parameter #2 in call}} {{9-9=, <#() -> Int#>}}
115+
_ = s2[{ 1 }] // expected-error {{missing argument for parameter #1 in call}} {{8-8=<#Int#>, }}
116+
_ = s2[] { 1 } // expected-error {{missing argument for parameter #1 in call}} {{8-8=<#Int#>}}
118117
_ = s2 { 1 } // expected-error {{cannot call value of non-function type 'S2'}} {{none}}
119-
_ = s2[] // expected-error {{missing argument for parameter #1 in call}} {{8-8=<#Int#>}}
118+
_ = s2[] // expected-error {{missing arguments for parameters #1, #2 in call}} {{8-8=<#Int#>, <#() -> Int#>}}
120119
s2[1, {1}] = 1 // Ok.
121120
s2[1] { 1 } = 1 // Ok.
122-
s2[1] = 1 // expected-error {{cannot convert value of type 'Int' to expected argument type '(Int, () -> Int)'}} {{none}}
123-
s2[{ 1 }] = 1 // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)'}} {{none}}
124-
s2[] { 1 } = 1 // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)'}} {{none}}
121+
s2[1] = 1 // expected-error {{missing argument for parameter #2 in call}} {{5-5=, <#() -> Int#>}}
122+
s2[{ 1 }] = 1 // expected-error {{missing argument for parameter #1 in call}} {{4-4=<#Int#>, }}
123+
s2[] { 1 } = 1 // expected-error {{missing argument for parameter #1 in call}} {{4-4=<#Int#>}}
125124

126125
struct S3 {
127126
subscript(x x: Int, y y: Int, z z: (Int) -> Int) -> Int { get { return 1 } set { } } // expected-note * {{here}}
128127
}
129128
var s3 = S3()
130129
_ = s3[y: 1] { 1 } // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>, }}
130+
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{15-15= _ in}}
131131
_ = s3[x: 1] { 1 } // expected-error {{missing argument for parameter 'y' in call}} {{12-12=, y: <#Int#>}}
132+
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{15-15= _ in}}
132133
_ = s3[x: 1, y: 1] // expected-error {{missing argument for parameter 'z' in call}} {{18-18=, z: <#(Int) -> Int#>}}
133134
s3[y: 1] { 1 } = 1 // expected-error {{missing argument for parameter 'x' in call}} {{4-4=x: <#Int#>, }}
135+
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{11-11= _ in}}
134136
s3[x: 1] { 1 } = 1 // expected-error {{missing argument for parameter 'y' in call}} {{8-8=, y: <#Int#>}}
137+
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{11-11= _ in}}
135138
s3[x: 1, y: 1] = 1 // expected-error {{missing argument for parameter 'z' in call}} {{14-14=, z: <#(Int) -> Int#>}}
136139

137140
struct S4 {
138141
subscript(x: Int, y: Int, z: (Int) -> Int) -> Int { get { return 1 } set { } } // expected-note * {{here}}
139142
}
140143
var s4 = S4()
141144
_ = s4[1] { 1 } // expected-error {{missing argument for parameter #2 in call}} {{9-9=, <#Int#>}}
145+
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{12-12= _ in}}
142146
_ = s4[1, 1] // expected-error {{missing argument for parameter #3 in call}} {{12-12=, <#(Int) -> Int#>}}
143147
s4[1] { 1 } = 1 // expected-error {{missing argument for parameter #2 in call}} {{5-5=, <#Int#>}}
148+
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{8-8= _ in}}
144149
s4[1, 1] = 1 // expected-error {{missing argument for parameter #3 in call}} {{8-8=, <#(Int) -> Int#>}}
145150

146151
func multiLine(x: Int, y: Int, z: Int) {} // expected-note * {{here}}
147-
multiLine(
148-
) // expected-error {{missing argument for parameter 'x' in call}} {{1-1=x: <#Int#>}}
152+
multiLine( // expected-error {{missing arguments for parameters 'x', 'y', 'z' in call}} {{11-11=x: <#Int#>, y: <#Int#>, z: <#Int#>}}
153+
)
149154
multiLine(
150155
y: 1, // expected-error {{missing argument for parameter 'x' in call}} {{3-3=x: <#Int#>, }}
151156
z: 1

test/Constraints/diagnostics.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ f8(b: 1.0) // expected-error {{extraneous argument label 'b:' in call}}
409409
class CurriedClass {
410410
func method1() {}
411411
func method2(_ a: Int) -> (_ b : Int) -> () { return { b in () } }
412-
func method3(_ a: Int, b : Int) {} // expected-note 5 {{'method3(_:b:)' declared here}}
412+
func method3(_ a: Int, b : Int) {} // expected-note 3 {{'method3(_:b:)' declared here}}
413413
}
414414

415415
let c = CurriedClass()
@@ -449,15 +449,17 @@ _ = CurriedClass.method3(1, 2) // expected-error {{instance member 'me
449449
// expected-error@-1 {{missing argument label 'b:' in call}}
450450
CurriedClass.method3(c)(1.0, b: 1) // expected-error {{cannot convert value of type 'Double' to expected argument type 'Int'}}
451451
CurriedClass.method3(c)(1) // expected-error {{missing argument for parameter 'b' in call}}
452-
CurriedClass.method3(c)(c: 1.0) // expected-error {{missing argument for parameter #1 in call}}
452+
CurriedClass.method3(c)(c: 1.0) // expected-error {{missing argument for parameter #1 in call}} expected-error {{cannot convert value of type 'Double' to expected argument type 'Int'}}
453453

454454

455455
extension CurriedClass {
456456
func f() {
457457
method3(1, b: 2)
458-
method3() // expected-error {{missing argument for parameter #1 in call}}
458+
method3() // expected-error {{missing arguments for parameters #1, 'b' in call}} {{13-13=<#Int#>, b: <#Int#>}}
459459
method3(42) // expected-error {{missing argument for parameter 'b' in call}}
460-
method3(self) // expected-error {{missing argument for parameter 'b' in call}}
460+
method3(self)
461+
// expected-error@-1:13 {{cannot convert value of type 'CurriedClass' to expected argument type 'Int'}}
462+
// expected-error@-2:17 {{missing argument for parameter 'b' in call}} {{17-17=, b: <#Int#>}}
461463
}
462464
}
463465

test/Constraints/diagnostics_swift4.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum R31898542<T> {
3434
}
3535

3636
func foo() -> R31898542<()> {
37-
return .success() // expected-error {{missing argument for parameter #1 in call}} {{19-19=<#T#>}}
37+
return .success() // expected-error {{missing argument for parameter #1 in call}} {{19-19=<#()#>}}
3838
}
3939

4040
// rdar://problem/31973368 - Cannot convert value of type '(K, V) -> ()' to expected argument type '((key: _, value: _)) -> Void'

test/Constraints/enum_cases.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bar_1(E.tuple) // Ok - it's going to be ((x: Int, y: Int))
5454

5555
bar_2(G_E<String>.foo) // Ok
5656
bar_2(G_E<Int>.bar) // Ok
57-
bar_2(G_E<Int>.two) // expected-error {{cannot convert value of type '(Int, Int) -> G_E<Int>' to expected argument type '(_) -> G_E<_>'}}
57+
bar_2(G_E<Int>.two) // expected-error {{cannot convert value of type '(Int, Int) -> G_E<Int>' to expected argument type '(Int) -> G_E<Int>'}}
5858
bar_2(G_E<Int>.tuple) // expected-error {{cannot convert value of type '((x: Int, y: Int)) -> G_E<Int>' to expected argument type '(_) -> G_E<_>'}}
5959
bar_3(G_E<Int>.tuple) // Ok
6060

test/Constraints/members.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,14 @@ func rdar_50467583_and_50909555() {
620620

621621
// rdar://problem/50909555
622622
struct S {
623-
static subscript(x: Int, y: Int) -> Int {
623+
static subscript(x: Int, y: Int) -> Int { // expected-note {{'subscript(_:_:)' declared here}}
624624
return 1
625625
}
626626
}
627627

628628
func test(_ s: S) {
629629
s[1] // expected-error {{static member 'subscript' cannot be used on instance of type 'S'}} {{5-6=S}}
630+
// expected-error@-1 {{missing argument for parameter #2 in call}} {{8-8=, <#Int#>}}
630631
}
631632
}
632633

test/Constraints/rdar45242032.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ struct S {
1414
}
1515

1616
do {
17-
let _ = M.foo(bar & // expected-error {{missing argument for parameter 'bar' in call}}
17+
let _ = M.foo(bar & // expected-error {{missing arguments for parameters 'bar', 'baz' in call}}
1818
} // expected-error {{expected expression after operator}}
1919

2020
do {
21-
let _ = S.bar(fiz & // expected-error {{missing argument for parameter 'fiz' in call}}
21+
let _ = S.bar(fiz & // expected-error {{missing arguments for parameters 'fiz', 'baz' in call}}
2222
} // expected-error {{expected expression after operator}}

test/Constraints/tuple_arguments.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ func rdar48443263() {
17161716

17171717
func bar(_ s1: S1, _ s2: S2, _ fn: () -> Void) {
17181718
foo(s1, fn) // Ok because s.V is Void
1719-
foo(s2, fn) // expected-error {{cannot convert value of type '() -> Void' to expected argument type '(_) -> Void'}}
1719+
foo(s2, fn) // expected-error {{cannot convert value of type '() -> Void' to expected argument type '(S2.V) -> Void' (aka '(Int) -> ()')}}
17201720
}
17211721
}
17221722

test/Sema/diag_ambiguous_overloads.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct Count { // expected-note {{'init(title:)' declared here}}
114114
func getCounts(_ scheduler: sr5154_Scheduler, _ handler: @escaping ([Count]) -> Void) {
115115
scheduler.inBackground(run: {
116116
return [Count()] // expected-error {{missing argument for parameter 'title' in call}}
117-
}, completedBy: {
117+
}, completedBy: { // expected-error {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{20-20= _ in}}
118118
})
119119
}
120120

test/decl/func/constructor.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extension D {
7979
init() { i = 17 }
8080
}
8181

82-
F() // expected-error{{missing argument for parameter 'd'}}
82+
F() // expected-error{{missing arguments for parameters 'd', 'b', 'c' in call}}
8383
D() // okay // expected-warning{{unused}}
8484
B() // okay // expected-warning{{unused}}
8585
C() // expected-error{{missing argument for parameter 'd'}}

test/decl/func/default-values.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ let fooThing4 = Foo(a: 0, b: true, d: 1, e: 2, f: false, g: 10, h: nil) // ok
162162

163163
// Ensure that tuple init is not allowed
164164
// Here b = false and g = nil, but we're checking that e and f don't get a default value
165-
let fooThing5 = Foo(a: 0, d: 1, h: nil) // expected-error {{missing argument for parameter 'e' in call}}
165+
let fooThing5 = Foo(a: 0, d: 1, h: nil) // expected-error {{missing arguments for parameters 'e', 'f' in call}}
166166
// expected-note@-25 {{'init(a:b:d:e:f:g:h:)' declared here}}
167167

168168
// Here b = false and g = nil, but we're checking that f doesn't get a default value

test/decl/func/dynamic_self.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension P1 {
6262
// ----------------------------------------------------------------------------
6363
// The 'self' type of a Self method is based on Self
6464
class C1 {
65-
required init(int i: Int) {}
65+
required init(int i: Int) {} // expected-note {{'init(int:)' declared here}}
6666

6767
// Instance methods have a self of type Self.
6868
func f(_ b: Bool) -> Self {
@@ -89,7 +89,7 @@ class C1 {
8989

9090
if b { return self.init(int: 5) }
9191

92-
return Self() // expected-error{{non-nominal type 'Self' does not support explicit initialization}}
92+
return Self() // expected-error{{missing argument for parameter 'int' in call}} {{17-17=int: <#Int#>}}
9393
}
9494

9595
// This used to crash because metatype construction went down a

test/expr/closure/closures.swift

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func funcdecl5(_ a: Int, _ y: Int) {
4343

4444
var testfunc : ((), Int) -> Int // expected-note {{'testfunc' declared here}}
4545
testfunc({$0+1}) // expected-error {{missing argument for parameter #2 in call}}
46+
// expected-error@-1 {{cannot convert value of type '(Int) -> Int' to expected argument type '()'}}
4647

4748
funcdecl5(1, 2) // recursion.
4849

test/expr/expressions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,10 @@ _ = _.foo // expected-error {{type of expression is ambiguous without more conte
858858

859859
// <rdar://problem/22211854> wrong arg list crashing sourcekit
860860
func r22211854() {
861-
func f(_ x: Int, _ y: Int, _ z: String = "") {} // expected-note 2 {{'f' declared here}}
861+
func f(_ x: Bool, _ y: Int, _ z: String = "") {} // expected-note 2 {{'f' declared here}}
862862
func g<T>(_ x: T, _ y: T, _ z: String = "") {} // expected-note 2 {{'g' declared here}}
863863

864-
f(1) // expected-error{{missing argument for parameter #2 in call}}
864+
f(false) // expected-error{{missing argument for parameter #2 in call}}
865865
g(1) // expected-error{{missing argument for parameter #2 in call}}
866866
func h() -> Int { return 1 }
867867
f(h() == 1) // expected-error{{missing argument for parameter #2 in call}}

test/expr/postfix/dot/init_ref_delegation.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class RDar16666631 {
159159
var i: Int
160160
var d: Double
161161
var s: String
162-
init(i: Int, d: Double, s: String) {
162+
init(i: Int, d: Double, s: String) { // expected-note {{'init(i:d:s:)' declared here}}
163163
self.i = i
164164
self.d = d
165165
self.s = s
@@ -168,9 +168,7 @@ class RDar16666631 {
168168
self.init(i: i, d: 0.1, s: s)
169169
}
170170
}
171-
let rdar16666631 = RDar16666631(i: 5, d: 6) // expected-error {{incorrect argument label in call (have 'i:d:', expected 'i:s:')}}
172-
// expected-error@-1 {{cannot convert value of type 'Int' to expected argument type 'String'}}
173-
171+
let rdar16666631 = RDar16666631(i: 5, d: 6) // expected-error {{missing argument for parameter 's' in call}} {{43-43=, s: <#String#>}}
174172

175173
struct S {
176174
init() {

validation-test/Sema/type_checker_crashers_fixed/rdar48994658.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
struct Ref<Value> {
3+
struct Ref<Value> { // expected-note {{'Value' declared as parameter to type 'Ref'}}
44
static func foo(_ value: Int) {} // expected-note {{declared here}}
55
}
66

@@ -25,4 +25,6 @@ extension Ref : RefConvertible {
2525

2626
func rdar_48994658() {
2727
Ref.foo() // expected-error {{missing argument for parameter #1 in call}}
28+
// expected-error@-1 {{generic parameter 'Value' could not be inferred}}
29+
// expected-note@-2 {{explicitly specify the generic arguments to fix this issue}} {{6-6=<Any>}}
2830
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// RUN: %target-typecheck-verify-swift
22

33
class C {
4-
private init() {} // expected-note {{declared here}}
5-
init(n: Int) {}
4+
private init() {}
5+
init(n: Int) {} // expected-note {{'init(n:)' declared here}}
66
}
77

8+
// TODO(diagnostics): Once "inaccessible members" are ported to the new framework it would be possible
9+
// to bring back `'C' initializer is inaccessible due to 'private' protection level` diagnostic here.
810
_ = C()
9-
// expected-error@-1 {{'C' initializer is inaccessible due to 'private' protection level}}
11+
// expected-error@-1 {{missing argument for parameter 'n' in call}} {{7-7=n: <#Int#>}}

0 commit comments

Comments
 (0)