-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
custom implicitNotFound
ignored when unrelated default argument is inserted
#19594
Labels
Milestone
Comments
valencik
added
itype:bug
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Feb 1, 2024
Gedochao
added
area:annotations
regression
This worked in a previous version but doesn't anymore
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Feb 1, 2024
Happens also on |
bishabosha
changed the title
custom Feb 1, 2024
implicitNotFound
ignored when callsite has default argumentimplicitNotFound
ignored when unrelated default argument is inserted
I should add that you don't need the Given the following: import scala.annotation.implicitNotFound
@implicitNotFound("Can you see me?!")
trait Compare[A, B]
object minimunit {
def assertEquals[A, B](
a: A,
b: B,
// The presence of the below default argument prevents the `implicitNotFound` message from appearing
// in the error output of `typeCheckErrors` in Scala +3.1.3
clue: => Any = "values are not the same"
)(implicit comp: Compare[A, B]): Unit = ()
}
object example extends App {
minimunit.assertEquals(true, 1)
} On +3.1.3 we get a compile error:
And on 3.1.2 we see the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Compiler version
3.1.3+
(3.1.2 is the last version where the
implicitNotFound
is not ignored)Minimized code
Output
Scala 3.1.3
scala-cli run --scala-version 3.1.3 minimunit.scala
Scala 3.1.2
scala-cli run --scala-version 3.1.2 minimunit.scala
Expectation
The
implicitNotFound
message should appear whether or not there is a default argument involved.If we remove the
clue: => Any = "values are not the same"
line, theimplicitNotFound
message is again returned on Scala versions greater than 3.1.2I encountered this issue when trying to upgrade munit to Scala 3.3.1
scalameta/munit#733
The text was updated successfully, but these errors were encountered: