Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--doc option seems disabling type checking #23430

Closed
kt3k opened this issue Apr 18, 2024 · 1 comment · Fixed by #23654
Closed

--doc option seems disabling type checking #23430

kt3k opened this issue Apr 18, 2024 · 1 comment · Fixed by #23654

Comments

@kt3k
Copy link
Member

kt3k commented Apr 18, 2024

Save the below script as test.ts, and then deno test throws type error at const a, but deno test --doc doesn't throw type error.

/**
 * ```ts
 * ```
 */
function foo() {}

const a: string = 1;

If I remove the code block part in the jsdoc, then this issue doesn't happen.

Version: Deno 1.42.4

@crowlKats
Copy link
Member

After some searching, we found out that the issue is a regression from #22854. This is because of

let has_type_checked = !graph.roots.is_empty();
, and because the prepare_module_load function is called twice, once for doc files and once for actual files, it does not type check because on second call has_type_checked is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants