Skip to content

Commit e9c6d96

Browse files
authored
Add related span pointing at missing arguments (#27013)
1 parent 78c8003 commit e9c6d96

File tree

59 files changed

+235
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+235
-15
lines changed

src/compiler/checker.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19208,12 +19208,16 @@ namespace ts {
1920819208
let aboveArgCount = Number.POSITIVE_INFINITY;
1920919209

1921019210
let argCount = args.length;
19211+
let closestSignature: Signature | undefined;
1921119212
for (const sig of signatures) {
1921219213
const minCount = getMinArgumentCount(sig);
1921319214
const maxCount = getParameterCount(sig);
1921419215
if (minCount < argCount && minCount > belowArgCount) belowArgCount = minCount;
1921519216
if (argCount < maxCount && maxCount < aboveArgCount) aboveArgCount = maxCount;
19216-
min = Math.min(min, minCount);
19217+
if (minCount < min) {
19218+
min = minCount;
19219+
closestSignature = sig;
19220+
}
1921719221
max = Math.max(max, maxCount);
1921819222
}
1921919223

@@ -19226,16 +19230,29 @@ namespace ts {
1922619230
argCount--;
1922719231
}
1922819232

19233+
let related: DiagnosticWithLocation | undefined;
19234+
if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) {
19235+
const paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount];
19236+
if (paramDecl) {
19237+
related = createDiagnosticForNode(
19238+
paramDecl,
19239+
isBindingPattern(paramDecl.name) ? Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided : Diagnostics.An_argument_for_0_was_not_provided,
19240+
!paramDecl.name ? argCount : !isBindingPattern(paramDecl.name) ? idText(getFirstIdentifier(paramDecl.name)) : undefined
19241+
);
19242+
}
19243+
}
1922919244
if (hasRestParameter || hasSpreadArgument) {
1923019245
const error = hasRestParameter && hasSpreadArgument ? Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :
1923119246
hasRestParameter ? Diagnostics.Expected_at_least_0_arguments_but_got_1 :
1923219247
Diagnostics.Expected_0_arguments_but_got_1_or_more;
19233-
return createDiagnosticForNode(node, error, paramRange, argCount);
19248+
const diagnostic = createDiagnosticForNode(node, error, paramRange, argCount);
19249+
return related ? addRelatedInfo(diagnostic, related) : diagnostic;
1923419250
}
1923519251
if (min < argCount && argCount < max) {
1923619252
return createDiagnosticForNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, argCount, belowArgCount, aboveArgCount);
1923719253
}
19238-
return createDiagnosticForNode(node, Diagnostics.Expected_0_arguments_but_got_1, paramRange, argCount);
19254+
const diagnostic = createDiagnosticForNode(node, Diagnostics.Expected_0_arguments_but_got_1, paramRange, argCount);
19255+
return related ? addRelatedInfo(diagnostic, related) : diagnostic;
1923919256
}
1924019257

1924119258
function getTypeArgumentArityError(node: Node, signatures: ReadonlyArray<Signature>, typeArguments: NodeArray<TypeNode>) {

src/compiler/diagnosticMessages.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3708,6 +3708,14 @@
37083708
"category": "Message",
37093709
"code": 6209
37103710
},
3711+
"An argument for '{0}' was not provided.": {
3712+
"category": "Message",
3713+
"code": 6210
3714+
},
3715+
"An argument matching this binding pattern was not provided.": {
3716+
"category": "Message",
3717+
"code": 6211
3718+
},
37113719

37123720
"Projects to reference": {
37133721
"category": "Message",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts(5,1): error TS2554: Expected 3 arguments, but got 2.
2+
tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts(7,1): error TS2554: Expected 3 arguments, but got 2.
3+
4+
5+
==== tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts (2 errors) ====
6+
function foo(a, b, {c}): void {}
7+
8+
function bar(a, b, [c]): void {}
9+
10+
foo("", 0);
11+
~~~~~~~~~~
12+
!!! error TS2554: Expected 3 arguments, but got 2.
13+
!!! related TS6211 tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts:1:20: An argument matching this binding pattern was not provided.
14+
15+
bar("", 0);
16+
~~~~~~~~~~
17+
!!! error TS2554: Expected 3 arguments, but got 2.
18+
!!! related TS6211 tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts:3:20: An argument matching this binding pattern was not provided.
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//// [arityErrorRelatedSpanBindingPattern.ts]
2+
function foo(a, b, {c}): void {}
3+
4+
function bar(a, b, [c]): void {}
5+
6+
foo("", 0);
7+
8+
bar("", 0);
9+
10+
11+
//// [arityErrorRelatedSpanBindingPattern.js]
12+
function foo(a, b, _a) {
13+
var c = _a.c;
14+
}
15+
function bar(a, b, _a) {
16+
var c = _a[0];
17+
}
18+
foo("", 0);
19+
bar("", 0);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=== tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts ===
2+
function foo(a, b, {c}): void {}
3+
>foo : Symbol(foo, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 0))
4+
>a : Symbol(a, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 13))
5+
>b : Symbol(b, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 15))
6+
>c : Symbol(c, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 20))
7+
8+
function bar(a, b, [c]): void {}
9+
>bar : Symbol(bar, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 32))
10+
>a : Symbol(a, Decl(arityErrorRelatedSpanBindingPattern.ts, 2, 13))
11+
>b : Symbol(b, Decl(arityErrorRelatedSpanBindingPattern.ts, 2, 15))
12+
>c : Symbol(c, Decl(arityErrorRelatedSpanBindingPattern.ts, 2, 20))
13+
14+
foo("", 0);
15+
>foo : Symbol(foo, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 0))
16+
17+
bar("", 0);
18+
>bar : Symbol(bar, Decl(arityErrorRelatedSpanBindingPattern.ts, 0, 32))
19+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=== tests/cases/compiler/arityErrorRelatedSpanBindingPattern.ts ===
2+
function foo(a, b, {c}): void {}
3+
>foo : (a: any, b: any, { c }: { c: any; }) => void
4+
>a : any
5+
>b : any
6+
>c : any
7+
8+
function bar(a, b, [c]): void {}
9+
>bar : (a: any, b: any, [c]: [any]) => void
10+
>a : any
11+
>b : any
12+
>c : any
13+
14+
foo("", 0);
15+
>foo("", 0) : void
16+
>foo : (a: any, b: any, { c }: { c: any; }) => void
17+
>"" : ""
18+
>0 : 0
19+
20+
bar("", 0);
21+
>bar("", 0) : void
22+
>bar : (a: any, b: any, [c]: [any]) => void
23+
>"" : ""
24+
>0 : 0
25+

tests/baselines/reference/baseCheck.errors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'.
3232
class D extends C { constructor(public z: number) { super(this.z) } } // too few params
3333
~~~~~~~~~~~~~
3434
!!! error TS2554: Expected 2 arguments, but got 1.
35+
!!! related TS6210 tests/cases/compiler/baseCheck.ts:1:34: An argument for 'y' was not provided.
3536
~~~~
3637
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
3738
class E extends C { constructor(public z: number) { super(0, this.z) } }

tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts(16,1): error T
3434
foo(10);
3535
foo(); // not ok - needs number
3636
~~~~~
37-
!!! error TS2554: Expected 1 arguments, but got 0.
37+
!!! error TS2554: Expected 1 arguments, but got 0.
38+
!!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationES5.ts:1:14: An argument for 'a' was not provided.

tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts(16,1): error T
3434
foo(10);
3535
foo(); // not ok - needs number
3636
~~~~~
37-
!!! error TS2554: Expected 1 arguments, but got 0.
37+
!!! error TS2554: Expected 1 arguments, but got 0.
38+
!!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationES6.ts:1:14: An argument for 'a' was not provided.

tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): e
3131
foo(); // not ok - needs number
3232
~~~~~
3333
!!! error TS2554: Expected 1 arguments, but got 0.
34+
!!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts:2:14: An argument for 'a' was not provided.
3435
}
3536
foo(10);
3637
foo(); // not ok - needs number
3738
~~~~~
38-
!!! error TS2554: Expected 1 arguments, but got 0.
39+
!!! error TS2554: Expected 1 arguments, but got 0.
40+
!!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES5.ts:2:14: An argument for 'a' was not provided.

tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): e
2525
foo(); // not ok
2626
~~~~~
2727
!!! error TS2554: Expected 1 arguments, but got 0.
28+
!!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts:2:14: An argument for 'a' was not provided.
2829
}
2930
foo(10);
3031
foo(); // not ok - needs number
3132
~~~~~
32-
!!! error TS2554: Expected 1 arguments, but got 0.
33+
!!! error TS2554: Expected 1 arguments, but got 0.
34+
!!! related TS6210 tests/cases/compiler/blockScopedSameNameFunctionDeclarationStrictES6.ts:2:14: An argument for 'a' was not provided.

tests/baselines/reference/callWithSpread2.errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(34,8): erro
6868
prefix(...ns) // required parameters are required
6969
~~~~~~~~~~~~~
7070
!!! error TS2556: Expected 1-3 arguments, but got 0 or more.
71+
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts:3:25: An argument for 's' was not provided.
7172
prefix(...mixed)
7273
~~~~~~~~~~~~~~~~
7374
!!! error TS2556: Expected 1-3 arguments, but got 0 or more.
75+
!!! related TS6210 tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts:3:25: An argument for 's' was not provided.
7476
prefix(...tuple)
7577
~~~~~~~~
7678
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

tests/baselines/reference/classCanExtendConstructorFunction.errors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ tests/cases/conformance/salsa/second.ts(17,15): error TS2345: Argument of type '
4242
super(); // error: not enough arguments
4343
~~~~~~~
4444
!!! error TS2554: Expected 1 arguments, but got 0.
45+
!!! related TS6210 tests/cases/conformance/salsa/first.js:5:16: An argument for 'numberOxen' was not provided.
4546
this.foonly = 12
4647
}
4748
/**

tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
1717
var c = new C(); // error
1818
~~~~~~~
1919
!!! error TS2554: Expected 1 arguments, but got 0.
20+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts:2:17: An argument for 'x' was not provided.
2021
var c2 = new C(1); // ok
2122

2223
class Base2<T,U> {
@@ -31,6 +32,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
3132
var d = new D(); // error
3233
~~~~~~~
3334
!!! error TS2554: Expected 1 arguments, but got 0.
35+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts:14:17: An argument for 'x' was not provided.
3436
var d2 = new D(1); // ok
3537

3638
// specialized base class
@@ -42,6 +44,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
4244
var d3 = new D(); // error
4345
~~~~~~~
4446
!!! error TS2554: Expected 1 arguments, but got 0.
47+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts:14:17: An argument for 'x' was not provided.
4548
var d4 = new D(1); // ok
4649

4750
class D3 extends Base2<string, number> {
@@ -52,4 +55,5 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseCl
5255
var d5 = new D(); // error
5356
~~~~~~~
5457
!!! error TS2554: Expected 1 arguments, but got 0.
58+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts:14:17: An argument for 'x' was not provided.
5559
var d6 = new D(1); // ok

tests/baselines/reference/classWithConstructors.errors.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
1515
var c = new C(); // error
1616
~~~~~~~
1717
!!! error TS2554: Expected 1 arguments, but got 0.
18+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts:3:21: An argument for 'x' was not provided.
1819
var c2 = new C(''); // ok
1920

2021
class C2 {
@@ -26,6 +27,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
2627
var c3 = new C2(); // error
2728
~~~~~~~~
2829
!!! error TS2554: Expected 1 arguments, but got 0.
30+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts:10:21: An argument for 'x' was not provided.
2931
var c4 = new C2(''); // ok
3032
var c5 = new C2(1); // ok
3133

@@ -34,6 +36,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
3436
var d = new D(); // error
3537
~~~~~~~
3638
!!! error TS2554: Expected 1 arguments, but got 0.
39+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts:10:21: An argument for 'x' was not provided.
3740
var d2 = new D(1); // ok
3841
var d3 = new D(''); // ok
3942
}
@@ -46,6 +49,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
4649
var c = new C(); // error
4750
~~~~~~~
4851
!!! error TS2554: Expected 1 arguments, but got 0.
52+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts:28:21: An argument for 'x' was not provided.
4953
var c2 = new C(''); // ok
5054

5155
class C2<T,U> {
@@ -57,6 +61,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
5761
var c3 = new C2(); // error
5862
~~~~~~~~
5963
!!! error TS2554: Expected 1-2 arguments, but got 0.
64+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts:35:21: An argument for 'x' was not provided.
6065
var c4 = new C2(''); // ok
6166
var c5 = new C2(1, 2); // ok
6267

@@ -65,6 +70,7 @@ tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstr
6570
var d = new D(); // error
6671
~~~~~~~
6772
!!! error TS2554: Expected 1-2 arguments, but got 0.
73+
!!! related TS6210 tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts:35:21: An argument for 'x' was not provided.
6874
var d2 = new D(1); // ok
6975
var d3 = new D(''); // ok
7076
}

tests/baselines/reference/cloduleTest2.errors.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments,
1515
var r = new m3d(); // error
1616
~~~~~~~~~
1717
!!! error TS2554: Expected 1 arguments, but got 0.
18+
!!! related TS6210 tests/cases/compiler/cloduleTest2.ts:3:37: An argument for 'foo' was not provided.
1819
}
1920

2021
module T2 {
@@ -23,6 +24,7 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments,
2324
var r = new m3d(); // error
2425
~~~~~~~~~
2526
!!! error TS2554: Expected 1 arguments, but got 0.
27+
!!! related TS6210 tests/cases/compiler/cloduleTest2.ts:8:37: An argument for 'foo' was not provided.
2628
}
2729

2830
module T3 {
@@ -56,8 +58,10 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments,
5658
var r = new m3d(); // error
5759
~~~~~~~~~
5860
!!! error TS2554: Expected 1 arguments, but got 0.
61+
!!! related TS6210 tests/cases/compiler/cloduleTest2.ts:32:33: An argument for 'foo' was not provided.
5962

6063
declare class m4d extends m3d { }
6164
var r2 = new m4d(); // error
6265
~~~~~~~~~
63-
!!! error TS2554: Expected 1 arguments, but got 0.
66+
!!! error TS2554: Expected 1 arguments, but got 0.
67+
!!! related TS6210 tests/cases/compiler/cloduleTest2.ts:32:33: An argument for 'foo' was not provided.

tests/baselines/reference/constructorFunctions.errors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ tests/cases/conformance/salsa/index.js(55,13): error TS2554: Expected 1 argument
6565
var c7_v1 = new C7();
6666
~~~~~~~~
6767
!!! error TS2554: Expected 1 arguments, but got 0.
68+
!!! related TS6210 tests/cases/conformance/salsa/index.js:53:13: An argument for 'num' was not provided.
6869

tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
1616
var r = new Derived(); // error
1717
~~~~~~~~~~~~~
1818
!!! error TS2554: Expected 1 arguments, but got 0.
19+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts:3:17: An argument for 'x' was not provided.
1920
var r2 = new Derived(1);
2021

2122
class Base2<T> {
@@ -31,4 +32,5 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
3132
var d = new D(); // error
3233
~~~~~~~
3334
!!! error TS2554: Expected 1 arguments, but got 0.
35+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts:16:17: An argument for 'x' was not provided.
3436
var d2 = new D(new Date()); // ok

tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
1818
var r = new Derived(); // error
1919
~~~~~~~~~~~~~
2020
!!! error TS2554: Expected 1-3 arguments, but got 0.
21+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts:3:17: An argument for 'x' was not provided.
2122
var r2 = new Derived(1);
2223
var r3 = new Derived(1, 2);
2324
var r4 = new Derived(1, 2, 3);
@@ -37,6 +38,7 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
3738
var d = new D(); // error
3839
~~~~~~~
3940
!!! error TS2554: Expected 1-3 arguments, but got 0.
41+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts:20:17: An argument for 'x' was not provided.
4042
var d2 = new D(new Date()); // ok
4143
var d3 = new D(new Date(), new Date());
4244
var d4 = new D(new Date(), new Date(), new Date());

tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
2828
var r = new Derived(); // error
2929
~~~~~~~~~~~~~
3030
!!! error TS2554: Expected 2 arguments, but got 0.
31+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts:10:17: An argument for 'y' was not provided.
3132
var r2 = new Derived2(1); // error
3233
~~~~~~~~~~~~~~~
3334
!!! error TS2554: Expected 2 arguments, but got 1.
35+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts:10:28: An argument for 'z' was not provided.
3436
var r3 = new Derived('', '');
3537

3638
class Base2<T> {
@@ -55,7 +57,9 @@ tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/de
5557
var d = new D2(); // error
5658
~~~~~~~~
5759
!!! error TS2554: Expected 2 arguments, but got 0.
60+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts:32:17: An argument for 'y' was not provided.
5861
var d2 = new D2(new Date()); // error
5962
~~~~~~~~~~~~~~~~~~
6063
!!! error TS2554: Expected 2 arguments, but got 1.
64+
!!! related TS6210 tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts:32:23: An argument for 'z' was not provided.
6165
var d3 = new D2(new Date(), new Date()); // ok

0 commit comments

Comments
 (0)