Skip to content

Commit 6c735b5

Browse files
committed
Add contextual typing test with this specified
1 parent 921d5f8 commit 6c735b5

File tree

4 files changed

+162
-122
lines changed

4 files changed

+162
-122
lines changed

tests/baselines/reference/thisTypeInFunctions.js

+7
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ c.explicitC = function(m) { return this.n + m };
129129
c.explicitProperty = function(m) { return this.n + m };
130130
c.explicitThis = function(m) { return this.n + m };
131131

132+
// this: contextual typing
133+
c.explicitThis = function(this, m) { return this.n + m };
134+
135+
// this: superclass compatibility
132136
c.explicitC = function(this: B, m: number) { return this.n + m };
133137

134138
// this:void compatibility
@@ -314,6 +318,9 @@ c.explicitThis = function (m) { return this.n + m; };
314318
c.explicitC = function (m) { return this.n + m; };
315319
c.explicitProperty = function (m) { return this.n + m; };
316320
c.explicitThis = function (m) { return this.n + m; };
321+
// this: contextual typing
322+
c.explicitThis = function (m) { return this.n + m; };
323+
// this: superclass compatibility
317324
c.explicitC = function (m) { return this.n + m; };
318325
// this:void compatibility
319326
c.explicitVoid = function (n) { return n; };

0 commit comments

Comments
 (0)