Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

feat: move nil check to call sites#658

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SoulPancake wants to merge8 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromSoulPancake:ab/isFuncLikeDecrl

Conversation

SoulPancake
Copy link

@SoulPancakeSoulPancake commentedMar 18, 2025
edited
Loading

This addresses

// TODO(rbuckton): Movenode != niltest to call sites
@rbuckton Can you please review this
I can undo the stylistic whitespace changes in the internal/ast/utilities.g
but I think they're for the better, LMK what you think

@SoulPancakeSoulPancake changed the titlefeat: moving nil check to call sites of IsFunctionLikeDeclarationfeat: move nil check to call sites - IsFunctionLikeDeclarationMar 18, 2025
@SoulPancakeSoulPancake changed the titlefeat: move nil check to call sites - IsFunctionLikeDeclarationfeat: move nil check to call sitesMar 18, 2025
@SoulPancake
Copy link
Author

@rbuckton Can you take a look at this?

@SaadiSave
Copy link

SaadiSave commentedMay 7, 2025
edited
Loading

@SoulPancake Sorry for jumping on here for a slightly tangential issue, but I noticed that nil checks are inconsistent throughout the codebase. For example,

https://github.com/microsoft/typescript-go/blob/main/internal%2Fast%2Fast.go#L15-L31

typeVisitorfunc(*Node)boolfuncvisit(vVisitor,node*Node)bool {ifnode!=nil {returnv(node)        }returnfalse}funcvisitNodes(vVisitor,nodes []*Node)bool {for_,node:=rangenodes {ifv(node) {returntrue                }        }returnfalse}

visit checks for nils, but the for loop doesn't check ifnode is nil. Do you have clear documentation on whetherVisitors are supposed to handle nils? Becausevisit assumes they don't, andvisitNodes assumes they do, which are mutually incompatible assumptions.

@SoulPancake
Copy link
Author

@SaadiSave Agreed, I will add the nil check in the loop

@SaadiSave
Copy link

@SoulPancake is there a lint to enforce nil checks?

@SoulPancake
Copy link
Author

Don't think so@SaadiSave

@rbucktonrbuckton removed their assignmentMay 25, 2025
@jakebaileyjakebailey removed the request for review fromrbucktonJune 24, 2025 23:13
@jakebailey
Copy link
Member

This PR has gotten out of date as main changed. Could you update it, or close it if you don't plan on working on this anymore?

@SoulPancake
Copy link
Author

I will update it asap@jakebailey

@SoulPancake
Copy link
Author

@jakebailey Done, Can you take a look at this?

@jakebailey
Copy link
Member

I feel like most of these are redundant; I would think we'd only want ones that correspond to undefined checks in the original code.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jakebaileyjakebaileyjakebailey left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@SoulPancake@SaadiSave@jakebailey@rbuckton

[8]ページ先頭

©2009-2025 Movatter.jp