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

ts-check error ts(2554) after upgrading to 1.46.1 when calling class member function with optionals #39261

Copy link
Copy link
@ValYouW

Description

@ValYouW
Issue body actions
  • VSCode Version: 1.46.1 (commit: cd9ea6)
  • OS Version: Windows 10 Pro Version 10.0.19041 Build 19041

After upgrading today to 1.46.1 I started to get many ts(2554) errors (expected X arguments, but got Y) when omitting optional args on a class member function.
For example:

// utils.js
module.exports.foo = function(a) {
  console.log(a);1
}

class SomeClass {
  foo(a) {
    console.log(a);
  }
}

module.exports.SomeClass = SomeClass;
// main.js
var Utils = require('./utils.js');
var sc = new Utils.SomeClass();

sc.foo(); // This will error
Utils.foo(); // no error
innerFoo(); // no error

function innerFoo(a) {
  console.log(a);
}

Attached screenshot with this simple example:
tscheck

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

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