8000 Update README.md · SwiftDocOrg/SwiftSemantics@9565f84 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Commit 9565f84

Browse files
authored
Update README.md
I believe the current README example code `tree.walk` is incorrect, and uses a method that was removed in [version 5.2 of swift-syntax](https://github.com/apple/swift-syntax/blob/master/Changelog.md#swift-52). Trying to run similar code in a new project results in "error: value of type 'SourceFileSyntax' has no member 'walk'". Changing it to `collector.walk(tree)` seems to have the expected result.
1 parent 31a3519 commit 9565f84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ViewController: UIViewController, UITableViewDelegate {
3232

3333
var collector = DeclarationCollector()
3434
let tree = try SyntaxParser.parse(source: source)
35-
tree.walk(&collector)
35+
collector.walk(tree)
3636

3737
// Import declarations
3838
collector.imports.first?.pathComponents // ["UIKit"]

0 commit comments

Comments
 (0)
0