CARVIEW |
Select Language
HTTP/2 200
date: Mon, 21 Jul 2025 09:45:58 GMT
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
link: ; rel=preload; as=fetch; crossorigin=use-credentials
referrer-policy: no-referrer-when-downgrade
server-timing: issue_layout-fragment;desc="issue_layout fragment";dur=265.717389,issue_conversation_content-fragment;desc="issue_conversation_content fragment";dur=708.041549,issue_conversation_sidebar-fragment;desc="issue_conversation_sidebar fragment";dur=58.682275,nginx;desc="NGINX";dur=1.40839,glb;desc="GLB";dur=95.679382
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, Accept,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=%2BFVxtDj%2BN9IYXT03Tz3C8mceRqTheeFfePB%2BVahpDik%2BOiFoPOcPlc62FM%2BKiglIcpPqhLz1M6lWS9gRRv0ZkRFksu0yjKsz2jfSLZuQV9ki68M1FJN7X8vvLR2jHYL6BCd5jJzyPKe9p9Z7vLFAxqHNQ2IBZIJjLZlVX1tjEijZmhFUDpjLcn1eYOfAmzmvfK%2BVl6ui2vM%2FZodIlS%2BmQfW%2BUc2btnmdC3C0eTbb2RcVDRfypqWt0ii6tMsyi3jtSgilvz5wSLSc96n3CR6K6A%3D%3D--Q8zeW9iZC6bH0H%2BH--hf5iCc2L0WUImrdmc1teag%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2079303441.1753091157; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 09:45:57 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 09:45:57 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 95AC:1C7ED6:FF3746:1403DAF:687E0C55
Meta-issue: `this` disambiguator · Issue #513 · microsoft/TypeScript · GitHub

Specify
Specify, as part of a function, the type of
Specify, as part of a function type, the type of
Specify the what valid
No one assignedNo typeNo projectsNo milestoneNone yetNo branches or pull requests
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdMeta-IssueAn issue about the team, or the direction of TypeScriptAn issue about the team, or the direction of TypeScriptSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Do not discuss the details of these in this bug! Go to the appropriate linked issue to discuss them
This issue is to track all the various this
proposals floating around and to distinguish them. Any comments here should be clarifying comments/questions.
Specify this
as a function return value
Let type definitions specify that the type of a field (or maybe just function return values) is the same as the type that contains the property.
Example:
interface Animal {
clone(): this; // Today: clone(): Animal;
self: this;
}
interface Dog extends Animal { woof(); }
interface Cat extends Animal { meow(); }
var c: Cat;
var cc = c.clone(); // Desired: cc: Cat
cc.meow(); // Desired: OK. Today: Fails
var ccc = cc.self; // Desired: ccc: Cat
Specify, as part of a function, the type of this
inside the function body
Allow a syntax to specify the type of this
as part of a function expression.
Example:
function fn(this: HTMLElement) {
this.focus(); // OK
}
fn(); // 'this' argument not visible externally. May or may not be error
Specify, as part of a function type, the type of this
inside a function body
(no issue yet, please leave a comment if you create one)
Allow a syntax to specify that when a function is invoked, this
will be of a certain type
Example:
// https://api.jquery.com/jquery.each/
function jquery_each<T>(items: T[], callback: (this: T, index: number, value: T) { /* ... */ }
jquery_each(['foo', 'bar'], () => console.log(this.substr(1));
Specify the what valid this
values are during function invocation
Add type system logic to detect when a method is being invoked without a proper this
context
class Foo {
bar = 5;
printBar() { console.log(this.bar); }
}
var f = new Foo();
// prints 'undefined', not '5'
window.setImmediate(f.printBar); // Flag this as an error
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdMeta-IssueAn issue about the team, or the direction of TypeScriptAn issue about the team, or the direction of TypeScriptSuggestionAn idea for TypeScriptAn idea for TypeScript
Type
Projects
Milestone
Relationships
Development
Issue actions
You can’t perform that action at this time.