-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt implicit search for old style
implicit
parameters
(not only `using` params) [Cherry-picked 1e89016]
- Loading branch information
1 parent
ecb75d7
commit 4a1ea5f
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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?! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |