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

parse error #2139

Closed
gfrison opened this issue Dec 12, 2024 · 15 comments · Fixed by #2088
Closed

parse error #2139

gfrison opened this issue Dec 12, 2024 · 15 comments · Fixed by #2088
Labels

Comments

@gfrison
Copy link

gfrison commented Dec 12, 2024

scala version: 3.6.2
scalafix version: 0.13.0

error: `]` expected but `:` found
[error]   type Jf[F[*] <: FunExpr[*]]    = [T:Show] => (F[T], Null) => Juro[T]
[error]                                      ^

I get an error on [T:Show] which compiles correctly

@tgodzik
Copy link
Contributor

tgodzik commented Dec 12, 2024

Looks like an issue with the parser. Might be good to raise in scalameta/scalameta repository

@tgodzik
Copy link
Contributor

tgodzik commented Dec 13, 2024

Ach, I finally got time to look at it properly and maybe you are missing something like:

OrganizeImports.targetDialect = StandardLayout

?

@gfrison
Copy link
Author

gfrison commented Dec 13, 2024

same problem like above

[error] (scalafixAll) scalafix.sbt.ScalafixFailed: ParseError

@tgodzik
Copy link
Contributor

tgodzik commented Dec 17, 2024

What's the relative path of the file it fails on? Sorry for the late response, I just totally forgot I haven't commented here

@gfrison
Copy link
Author

gfrison commented Dec 17, 2024

reticolo/shared/src/main/scala/kubrick/reticolo/JuroFactory.scala do you need more info?

@tgodzik
Copy link
Contributor

tgodzik commented Dec 17, 2024

It it's plain Scala 3 project you might need to do OrganizeImports.targetDialect = Scala3 instead.

@gfrison
Copy link
Author

gfrison commented Dec 17, 2024

this is the config:

rules = [OrganizeImports,RemoveUnused,RedundantSyntax,NoAutoTupling]
OrganizeImports.targetDialect = Scala3

@tgodzik
Copy link
Contributor

tgodzik commented Dec 17, 2024

The other option I guess is that the way you are running scalafix is not setting the binary version properly.

How are you running it?

@gfrison
Copy link
Author

gfrison commented Dec 17, 2024

sbt

sbt:reticolo> scalafixAll
[info] Running scalafix on 22 Scala sources
[info] Running scalafix on 11 Scala sources (incremental)
[error] /home/d062226/ws/kubrick/reticolo/shared/src/main/scala/kubrick/reticolo/JuroFactory.scala:17:38: error: `]` expected but `:` found
[error]   type Jf[F[*] <: FunExpr[*]]    = [T:Show] => (F[T], Null) => Juro[T]
[error]                                      ^
[error] (scalafixAll) scalafix.sbt.ScalafixFailed: ParseError
[error] Total time: 2 s, completed Dec 17, 2024, 1:08:09 PM

@gfrison
Copy link
Author

gfrison commented Dec 17, 2024

scalamft:

version = "3.8.3"
align.preset = more    
runner.dialect = scala3
maxColumn = 120

@gfrison
Copy link
Author

gfrison commented Dec 17, 2024

I notice the problem exists also on launching scalafmtAll, but with scalafmt version 3.8.4-RC3 the error on scalafmtAll disappear. The error still persists on scalafixAll with scalafmt-3.8.4-R3

@tgodzik
Copy link
Contributor

tgodzik commented Dec 17, 2024

Maybe it's just the case of needing to bump scalameta version 🤔

@tgodzik
Copy link
Contributor

tgodzik commented Dec 17, 2024

And that would be blocked on #2128

@bjaglin do you need help here? I can merge things and release new version.

@bjaglin
Copy link
Collaborator

bjaglin commented Dec 18, 2024

@tgodzik I was hoping we could wait for the new 2.13 release, but I will tag a patch tomorrow with the latest scalameta

@bjaglin bjaglin linked a pull request Dec 23, 2024 that will close this issue
1 task
@bjaglin
Copy link
Collaborator

bjaglin commented Dec 23, 2024

@gfrison can you confirm that the latest snapshot fixes your problem? Thanks!

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

Successfully merging a pull request may close this issue.

3 participants