Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ trait Applications extends Compatibility {
defaultArg.tpe.widen match
case _: MethodOrPoly if testOnly => matchArgs(args1, formals1, n + 1)
case _ => matchArgs(args1, addTyped(treeToArg(defaultArg)), n + 1)
else if methodType.isContextualMethod && ctx.mode.is(Mode.ImplicitsEnabled) then
else if methodType.isImplicitMethod && ctx.mode.is(Mode.ImplicitsEnabled) then
matchArgs(args1, addTyped(treeToArg(implicitArg)), n + 1)
else
missingArg(n)
Expand Down
8 changes: 8 additions & 0 deletions tests/neg/i19594.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- [E172] Type Error: tests/neg/i19594.scala:12:14 ---------------------------------------------------------------------
12 | assertEquals(true, 1, "values are not the same") // error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Can you see me?!
-- [E172] Type Error: tests/neg/i19594.scala:13:14 ---------------------------------------------------------------------
13 | assertEquals(true, 1) // error
| ^^^^^^^^^^^^^^^^^^^^^
| Can you see me?!
13 changes: 13 additions & 0 deletions tests/neg/i19594.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import scala.annotation.implicitNotFound

@implicitNotFound("Can you see me?!")
trait Compare[A, B]

object example extends App:

// The presence of the below default argument prevents the `implicitNotFound` message from appearing
def assertEquals[A, B](a: A, b: B, clue: => Any = "values are not the same")
(implicit comp: Compare[A, B]): Unit = ()

assertEquals(true, 1, "values are not the same") // error
assertEquals(true, 1) // error