microsoft / microsoft/monaco-editor

[Bug] typescript type check

Open
#4,467 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.47.0#XQAAAALkBAAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw7VuRmAlP8UHl2wTDSACH-qdgDy04VOvD7Jmc6fs3N2mfiPPtNst-DOIbdc9WJIeJWkZ_8CKRyWOAPtv8hjI2Q2FNfCzKK6_qZOxN-SICsCgqt89H-1cX5-iQ-rI1OUyebpgJrcyYrLSaQuHGmc2O7p3waofGmpJ2_RqEA05xpQ9qNCFTGnCpb2RZbnIymB9i78qLLlfq3SAM8KuTfthQ5BEQ2gGRBT6kb_wsQAkaAWRWe_2LcbzC4D2kxo5IgQ0p3R_ERItVwZe1afxNhUNwfdJm9-GeX8T6PInV70kUsPIJJtAz9UeNspMaIRZre84RqmaXLa_fBdXnGMVmtihaWn1lFJfESDCQXkXU0wySzW8dFYOwnBwJN1xkBIS65yY6SbG9V5csxIvok2JwFuNDKkb9fBNJlRYt5CQFA7ni5DoqIJcZAlJyPVhXHdYkHg-VwcU5CdAsbIz0EcYBqc7CbPBfxKSJZTPPGVEJAPGTg_uo2rN0X1KFdxUK_-giUwnQsKWs-SYsETbkclSir1oiiAeuCO9SkbIyYt88NnIna47YYs01uSQSNZ9uZ8krC5Vt9fdwoMjcIT3IYk9oRLfj_FNIsatiMux24bZpRRkc322AO_0if3GxgkoE2qsoftcgLsHgzCGpnaJ0W81B82_QKQ00HiJegCUUhz3LBJh_uBcQZTI6lmk8M06gaSXPbvVgfukY4u9zac9fqf0wUyo

Monaco Editor Playground Code
class Test<T> {
}
class Test1 {
}
class Test2 {
}

declare class Global {
    static tryGetBean(bean: string):string;
    static tryGetBean(bean: number):number;
    static tryGetBean(bean: Test<string>):number;
}

Global.tryGetBean('123');
Global.tryGetBean(123);
let test1: Test<string> = new Test<string>();
let test2: Test<number> = new Test<number>();
let test3 = new Test1();
Global.tryGetBean(test1);
// why no errors
Global.tryGetBean(test2);
Global.tryGetBean(test3);
Reproduction Steps

Global.tryGetBean method called without type check.

Actual (Problematic) Behavior

no errors

Expected Behavior

Global.tryGetBean(test2);
Global.tryGetBean(test3);
report should error

Additional Context

noStrictGenericChecks: false,
noImplicitAny: false,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Monaco Editor Playground reproduction and run the provided TypeScript code to confirm the missing diagnostics for test2 and test3. Trace how the playground configures TypeScript checking, including noStrictGenericChecks and noImplicitAny, and compare the reported errors with the expected behavior. Done means both invalid calls produce type errors without regressing the valid overload calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.