SwiftSyntax parser library isn't compatible

I was trying mess around with Uber's Piranha project for Swift. When try and run the program, I get an error at the following line

 let parsed =  try SyntaxParser.parse(sourceFile)

When I catch the error I get "SwiftSyntax parser library isn't compatible" even though everything seems up to date.

I am currently on macOS Catalina 10.15.5 and swift version 5.2.4. Other people seem to be able to run the code on their computer, so I want to know how I can fix my local computer so that I can run this program.

It looks like Piranha has specified that it requires SwiftSyntax 0.50100.0 (piranha/Package.swift at master · uber/piranha · GitHub), which stands for Swift 5.1. They need to update it to the latest version of SwiftSyntax for you to be able to use it with Xcode 11.5.

1 Like