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

Compilation in Scala 3.5.0-RC5 gives possibly false errors #6627

Closed
brndt opened this issue Jul 25, 2024 · 7 comments
Closed

Compilation in Scala 3.5.0-RC5 gives possibly false errors #6627

brndt opened this issue Jul 25, 2024 · 7 comments
Assignees

Comments

@brndt
Copy link

brndt commented Jul 25, 2024

Describe the bug

Tests compilation gives some errors related to macros (the usage of ZLayers of zio) in editor but if you compile it using sbt you won't see any errors.
If I change the version to 3.4.2 errors disappear.

I don't see any errors when checking logs.

Expected behavior

No response

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

1.3.4

Extra context or search terms

No response

@brndt brndt changed the title Compilation in Scala 3.5.0-RC5 gives possible false errors Compilation in Scala 3.5.0-RC5 gives possibly false errors Jul 25, 2024
@tgodzik tgodzik self-assigned this Jul 29, 2024
@filipwiech
Copy link
Contributor

filipwiech commented Jul 30, 2024

I seem to be experiencing a similar issue.

"dev.optics" %% "monocle-core"  % "3.2.0" % "test",
"dev.optics" %% "monocle-macro" % "3.2.0" % "test",
"dev.optics" %% "monocle-law"   % "3.2.0" % "test",

import monocle.Lens
import monocle.macros.GenLens

case class Person(name: String, age: Int)

val lens: Lens[Person, String] = GenLens[Person](_.name)

SBT builds fine, but Bloop complains:

bloop: Found:    Any
Required: monocle.Lens[Person, String]

If I hover the cursor over the GenLens I get:

Expression type:
MkFocus[Person]

Symbol signature:
def apply[A]: MkFocus[A]

Which does appear to be correct.

The only error I can see in the Metals log is:

exception caught when loading class module-info: java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile

(There's no more details included.)

Hope that this will help to narrow down the problem. 👍

Scala 3.5.0-RC6, Bloop 1.6.0, SBT 1.10.1, Metals 1.3.4+23-c744a47f-SNAPSHOT

@tgodzik
Copy link
Contributor

tgodzik commented Jul 31, 2024

Looks like it's the same issue as #6628 correct me if I am wrong

@tgodzik tgodzik closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
@brndt
Copy link
Author

brndt commented Jul 31, 2024

Looks like it's the same issue as #6628 correct me if I am wrong

No it's not.
This one is something that you can reproduce without Best Effort compilation and modifying the code.
Just try to build test in the main branch of the repo that I shared with you and you will see some errors in Bloop that are not seen while using sbt.
The #6628 is related to BE compilation but this one can be reproduced with the older versions of Metals.

@tgodzik
Copy link
Contributor

tgodzik commented Jul 31, 2024

Do you mean these kind of errors?

image

Looking at the exact logs it seems that we are still compiling with best effort and this is fixed if I set it explicitely to false in metals

@brndt
Copy link
Author

brndt commented Jul 31, 2024

Ok, I didn't know it, I thought it wasn't related to Best Effort.
So in this case yes, you're right to close this issue as duplicated.

@tgodzik
Copy link
Contributor

tgodzik commented Jul 31, 2024

It should easily be fixed by reverting to earlier version of Metals since we do default to false, but somehow it still doesn't work. Switching Bloop version to an earlier one should work instead.

@tgodzik
Copy link
Contributor

tgodzik commented Jul 31, 2024

Looks like restarting the build server also helps, we might be caching it somewhere 🤔

Anyway, setting it explicitly works also, so will do that for now and create a new release

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