Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit abec46c

Browse filesBrowse files
committed
Test:spelling suggestions for more types
Test spelling suggestions for primitives, unions/intersections and type parameters with constraints.
1 parent e0bf267 commit abec46c
Copy full SHA for abec46c

6 files changed

+36-18Lines changed: 36 additions & 18 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
33
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1.
44
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
55
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
6-
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'.
6+
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'?
77

88

99
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts (6 errors) ====
@@ -87,7 +87,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
8787
function fn5() { return undefined; }
8888
fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'.
8989
~~~~~~~
90-
!!! error TS2339: Property 'toFixed' does not exist on type 'string'.
90+
!!! error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'?
9191
fn5 `${ (n) => n.substr(0) }`;
9292

9393

Collapse file

‎tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/conformance/jsx/file.tsx(19,16): error TS2559: Type '{ ref: "myRef"; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'.
2-
tests/cases/conformance/jsx/file.tsx(25,42): error TS2339: Property 'subtr' does not exist on type 'string'.
2+
tests/cases/conformance/jsx/file.tsx(25,42): error TS2551: Property 'subtr' does not exist on type 'string'. Did you mean 'substr'?
33
tests/cases/conformance/jsx/file.tsx(27,33): error TS2339: Property 'notARealProperty' does not exist on type 'BigGreeter'.
44
tests/cases/conformance/jsx/file.tsx(35,26): error TS2339: Property 'propertyNotOnHtmlDivElement' does not exist on type 'HTMLDivElement'.
55

@@ -33,7 +33,7 @@ tests/cases/conformance/jsx/file.tsx(35,26): error TS2339: Property 'propertyNot
3333
// Error ('subtr' not on string)
3434
let e = <BigGreeter ref={x => x.greeting.subtr(10)} />;
3535
~~~~~
36-
!!! error TS2339: Property 'subtr' does not exist on type 'string'.
36+
!!! error TS2551: Property 'subtr' does not exist on type 'string'. Did you mean 'substr'?
3737
// Error (ref callback is contextually typed)
3838
let f = <BigGreeter ref={x => x.notARealProperty} />;
3939
~~~~~~~~~~~~~~~~
Collapse file

‎tests/baselines/reference/unionPropertyExistence.errors.txt‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/unionPropertyExistence.errors.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tests/cases/compiler/unionPropertyExistence.ts(32,4): error TS2339: Property 'on
88
Property 'onlyInB' does not exist on type 'A'.
99
tests/cases/compiler/unionPropertyExistence.ts(35,5): error TS2339: Property 'notInC' does not exist on type 'ABC'.
1010
Property 'notInC' does not exist on type 'C'.
11-
tests/cases/compiler/unionPropertyExistence.ts(36,4): error TS2339: Property 'notInB' does not exist on type 'AB'.
11+
tests/cases/compiler/unionPropertyExistence.ts(36,4): error TS2551: Property 'notInB' does not exist on type 'AB'. Did you mean 'notInC'?
1212
Property 'notInB' does not exist on type 'B'.
1313
tests/cases/compiler/unionPropertyExistence.ts(37,5): error TS2339: Property 'notInB' does not exist on type 'ABC'.
1414
Property 'notInB' does not exist on type 'B'.
@@ -69,8 +69,8 @@ tests/cases/compiler/unionPropertyExistence.ts(40,5): error TS2339: Property 'in
6969
!!! error TS2339: Property 'notInC' does not exist on type 'C'.
7070
ab.notInB;
7171
~~~~~~
72-
!!! error TS2339: Property 'notInB' does not exist on type 'AB'.
73-
!!! error TS2339: Property 'notInB' does not exist on type 'B'.
72+
!!! error TS2551: Property 'notInB' does not exist on type 'AB'. Did you mean 'notInC'?
73+
!!! error TS2551: Property 'notInB' does not exist on type 'B'.
7474
abc.notInB;
7575
~~~~~~
7676
!!! error TS2339: Property 'notInB' does not exist on type 'ABC'.
Collapse file
+5-11Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
/// <reference path='fourslash.ts' />
22

3-
////[|class C {
4-
//// state = 'hi'
5-
//// doStuff() {
6-
//// this.start;
7-
//// }
3+
////[|function foo(s: string) {
4+
//// return s.toStrang();
85
////}|]
96

10-
verify.rangeAfterCodeFix(`class C {
11-
state = 'hi'
12-
doStuff() {
13-
this.state;
14-
}
15-
}`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 2);
7+
verify.rangeAfterCodeFix(`function foo(s: string) {
8+
return s.toString();
9+
}`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);
Collapse file
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////[|function foo<T extends number | string>(x: T) {
4+
//// return x.toStrang();
5+
////}|]
6+
7+
verify.rangeAfterCodeFix(`function foo<T extends number | string>(x: T) {
8+
return x.toString();
9+
}`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);
Collapse file
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////[|class C {
4+
//// state = 'hi'
5+
//// doStuff() {
6+
//// this.start;
7+
//// }
8+
////}|]
9+
10+
verify.rangeAfterCodeFix(`class C {
11+
state = 'hi'
12+
doStuff() {
13+
this.state;
14+
}
15+
}`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 2);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.