Skip to content

@this incorrectly applies in TS files in typeToString #52594

Closed
@sandersn

Description

@sandersn
// @strict: true
/** @this {number} */
function nothis/*1*/() {
  this // noImplicitThis error here
}
nothis() // `this` not required to call

Quickinfo at /*1*/, and type baselines, print the type of nothis as (this: number) => void, even in Typescript where the tag should be ignored. But the type checker still has this: any, so I think it's a bug inside typeToString.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions