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

Simple example no longer runs on scala 3.5.1 #320

Open
TimPigden opened this issue Sep 24, 2024 · 2 comments
Open

Simple example no longer runs on scala 3.5.1 #320

TimPigden opened this issue Sep 24, 2024 · 2 comments

Comments

@TimPigden
Copy link

import fastparse._
object TestFastParse {
def parseA[$: P] = P("a")

val Parsed.Success(value, successIndex) = parse("a", parseA(_))

assert(value == (), successIndex == 1)
}

.
/home/tim/repos/untitled/src/main/scala/TestFastParse.scala:5:56
Context bounds will map to context parameters.
A using clause is needed to pass explicit arguments to them.
This code can be rewritten automatically under -rewrite -source 3.4-migration.
val Parsed.Success(value, successIndex) = parse("a", parseA(_))

@vladimir-lu
Copy link

This can be manually worked around by replacing parse("a", parseA(_)) with parse("a", c => parseA(using c)) since a using keyword now appears to be required.

@coreyoconnor
Copy link

also applies to 3.6. Tho the error message is now No given instance of type fastparse.ParsingRun[$]

The change I applied is:

parse("a", parseA(using _))

which is easier than creating the lambda explicitly. Also: TIL about using _.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants