Skip to content

More type checking #398

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

Merged
merged 4 commits into from
Mar 1, 2025
Merged

More type checking #398

merged 4 commits into from
Mar 1, 2025

Conversation

ahejlsberg
Copy link
Member

In this PR:

  • Decorator type checking.
  • Unused identifier checking.
  • Minimal JSDoc checking (process @link directives for unused identifier checks).

With this PR, the VS Code project now compiles with no errors or warnings (and the fact that no unused identifiers are reported is indication that everything is being checked). Beyond JSDoc and JSX, very little remains to be ported in the type checker and performance should now be representative of what we'll see in the completed port.

@ahejlsberg ahejlsberg requested a review from jakebailey March 1, 2025 19:44
Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@ahejlsberg ahejlsberg added this pull request to the merge queue Mar 1, 2025
Merged via the queue into main with commit b2767ce Mar 1, 2025
17 checks passed

func (c *Checker) checkJSDocComment(node *ast.Node, location *ast.Node) {
switch node.Kind {
case ast.KindJSDocLink, ast.KindJSDocLinkCode, ast.KindJSDocLinkPlain:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agh, missed that this doesn't check @see, so won't catch everything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@see is a tag, so it is indeed checked (to link to a symbol in a @see tag you actually have to write @see {@link Foo}).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but the old compiler doesn't actually mark Foo as referenced because of an @see Foo tag. Maybe it should, but neither the old nor the new compiler has logic for that right now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, weird.

@jakebailey
Copy link
Member

With this PR, the VS Code project now compiles with no errors or warnings

I went to retest vscode and got a couple of errors still; maybe just that my version is newer? (Or older?)

@jakebailey jakebailey deleted the more-types-31 branch March 5, 2025 01:35
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 this pull request may close these issues.

2 participants