Skip to content

Commit 755ba73

Browse files
committed
Update looseThisTypeInFunctions baselines
1 parent c12cb83 commit 755ba73

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

tests/baselines/reference/looseThisTypeInFunctions.errors.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error
3333
!!! error TS2322: Type '(this: C, m: number) => number' is not assignable to type '(this: void, m: number) => number'.
3434
!!! error TS2322: The 'this' types of each signature are incompatible.
3535
!!! error TS2322: Type 'void' is not assignable to type 'C'.
36-
let o = {
36+
let o = {
3737
n: 101,
38-
explicitThis: function (m: number) {
39-
return m + this.n.length; // ok, this.n: any
38+
explicitThis: function (m: number) {
39+
return m + this.n.length; // error, 'length' does not exist on 'number'
4040
~~~~~~
4141
!!! error TS2339: Property 'length' does not exist on type 'number'.
4242
},
43-
implicitThis(m: number): number { return m; }
43+
implicitThis(m: number): number { return m; }
4444
};
4545
let i: I = o;
4646
let o2: I = {
@@ -66,4 +66,5 @@ tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error
6666
return this.n.length; // error, this.n: number
6767
~~~~~~
6868
!!! error TS2339: Property 'length' does not exist on type 'number'.
69-
}
69+
}
70+

tests/baselines/reference/looseThisTypeInFunctions.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class C implements I {
2020
}
2121
let c = new C();
2222
c.explicitVoid = c.explicitThis; // error, 'void' is missing everything
23-
let o = {
23+
let o = {
2424
n: 101,
25-
explicitThis: function (m: number) {
26-
return m + this.n.length; // ok, this.n: any
25+
explicitThis: function (m: number) {
26+
return m + this.n.length; // error, 'length' does not exist on 'number'
2727
},
28-
implicitThis(m: number): number { return m; }
28+
implicitThis(m: number): number { return m; }
2929
};
3030
let i: I = o;
3131
let o2: I = {
@@ -45,7 +45,8 @@ o.implicitThis = c.explicitThis; // ok, implicitThis(this:any) is assignable to
4545
o.implicitThis = i.explicitThis;
4646
i.explicitThis = function(m) {
4747
return this.n.length; // error, this.n: number
48-
}
48+
}
49+
4950

5051
//// [looseThisTypeInFunctions.js]
5152
var C = (function () {
@@ -67,7 +68,7 @@ c.explicitVoid = c.explicitThis; // error, 'void' is missing everything
6768
var o = {
6869
n: 101,
6970
explicitThis: function (m) {
70-
return m + this.n.length; // ok, this.n: any
71+
return m + this.n.length; // error, 'length' does not exist on 'number'
7172
},
7273
implicitThis: function (m) { return m; }
7374
};

0 commit comments

Comments
 (0)