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

Myriad throws errors when trying to process a file with new F# syntax #178

Open
OrfeasZ opened this issue Oct 10, 2024 · 2 comments
Open
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@OrfeasZ
Copy link

OrfeasZ commented Oct 10, 2024

I have a file that has a type that looks similar to this:

type MyType = {
  items: MyItem list
} with
  member self.itemIds = self.items |> List.map _.id

This uses the new _. shorthand syntax introduced in F# 8.

When trying to process this file, Myriad fails with the following error (and a bunch more after it):

OTHER: System.Exception: Error in Myriad.Plugins.LensesGenerator: LensesGenerator Failure
!CompilationError
Fantomas.Core.ParseException: ParseException
  [{ Severity = Error
     SubCategory = "parse"
     Range = Some (937,107--937,108)
     ErrorNumber = Some 10
     Message = "Unexpected symbol '_' in expression" };

Is this just a matter of updating the version of the F# compiler services & Fantomas used by Myriad? If so I'm happy to give it a go and submit a PR.

@joprice
Copy link

joprice commented Oct 11, 2024

I tried out updating fantomas and hit only one issue with CreateImplicitCtor where SynSimplePats switch to SynPat. I didn't have time to check what the right value should be, but after commenting it out, I was able to get it to run on code that uses the new placeholder function syntax https://github.com/MoiraeSoftware/myriad/compare/master...joprice:myriad:updateFantomas?expand=1#diff-bcdb0d0a4bdbc43b9b95e736fcaf924c2279e06b92feb05914291fd71db383ceR399

@7sharp9
Copy link
Collaborator

7sharp9 commented Oct 12, 2024

Yeah the version of FCS and Fantomas needs to be incremented to one that has the new AST components. Any updating the calls inot Fantomas that they changed.

@7sharp9 7sharp9 added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants