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

[SR-11591] SyntaxVisitor not visiting nodes as expected #414

Closed
swift-ci opened this issue Oct 9, 2019 · 2 comments
Closed

[SR-11591] SyntaxVisitor not visiting nodes as expected #414

swift-ci opened this issue Oct 9, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Oct 9, 2019

Previous ID SR-11591
Radar None
Original Reporter fdiaz (JIRA User)
Type Bug

Attachment: Download

Environment

MacOS 10.14.6, Xcode 10.3

Additional Detail from JIRA
Votes 1
Component/s SwiftSyntax
Labels Bug
Assignee None
Priority Medium

md5: 6740206789e6a4fdbe77197f956dbdb8

Issue Description:

The expectation is that SwiftRewriter and SwiftVisitor would behave exactly the same when visiting noted.

This doesn't seem to be the case, since in the attached code SwiftRewriter is triggered, while SwiftVisitor is not.

Confirmed this is a bug here

Small repro attached.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
@ahoppen
Copy link
Collaborator

ahoppen commented Jun 21, 2022

rdar://95635608

@ahoppen
Copy link
Collaborator

ahoppen commented Oct 18, 2022

Sorry for the super-late response here. The problem is that the visitor was called as

TypeConformanceVisitor().visit(sourceFile)

but calling visit on a SyntaxVisitor doesn’t do recursive visitation. The correct call should have been to walk.

TypeConformanceVisitor().walk(sourceFile)

If I change that, the rewriter and visitor behave the same.

@ahoppen ahoppen closed this as completed Oct 18, 2022
adevress pushed a commit to adevress/swift-syntax that referenced this issue Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants