-
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.
Fix implicitNotFound message for type aliases (#19343)
Fix #7092
- Loading branch information
Showing
5 changed files
with
98 additions
and
22 deletions.
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
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,32 @@ | ||
-- [E172] Type Error: tests/neg/i7092.scala:24:19 ---------------------------------------------------------------------- | ||
24 | summon[F[String]] // error | ||
| ^ | ||
| Not found for String | ||
-- [E172] Type Error: tests/neg/i7092.scala:25:19 ---------------------------------------------------------------------- | ||
25 | summon[G[String]] // error | ||
| ^ | ||
| Not found for String | ||
-- [E172] Type Error: tests/neg/i7092.scala:26:16 ---------------------------------------------------------------------- | ||
26 | summon[H[Int]] // error | ||
| ^ | ||
| Not found for Int, ?B | ||
-- [E172] Type Error: tests/neg/i7092.scala:27:23 ---------------------------------------------------------------------- | ||
27 | summon[H[Int][Float]] // error | ||
| ^ | ||
| Not found for Int, Float | ||
-- [E172] Type Error: tests/neg/i7092.scala:28:18 ---------------------------------------------------------------------- | ||
28 | summon[AAA[Int]] // error | ||
| ^ | ||
| Not found for Int | ||
-- [E172] Type Error: tests/neg/i7092.scala:29:25 ---------------------------------------------------------------------- | ||
29 | summon[AAA[Int][Float]] // error | ||
| ^ | ||
| Not found for Int | ||
-- [E172] Type Error: tests/neg/i7092.scala:30:19 ---------------------------------------------------------------------- | ||
30 | summon[op.F[Int]] // error | ||
| ^ | ||
| Could not find Int | ||
-- [E172] Type Error: tests/neg/i7092.scala:31:28 ---------------------------------------------------------------------- | ||
31 | summon[String =!:= String] // error | ||
| ^ | ||
| Cannot proof type inequality because types are equal: String =:= String |
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,31 @@ | ||
import scala.annotation.implicitNotFound | ||
import scala.util.NotGiven | ||
|
||
@implicitNotFound("Not found for ${A}") | ||
type F[A] | ||
|
||
@implicitNotFound("Not found for ${A}") | ||
trait G[A] | ||
|
||
@implicitNotFound("Not found for ${A}, ${B}") | ||
type H = [A] =>> [B] =>> (A, B) | ||
|
||
@implicitNotFound("Not found for ${A}") | ||
type AAA = [A] =>> [A] =>> A | ||
|
||
object op: | ||
@implicitNotFound("Could not find ${A}") | ||
opaque type F[A] = A | ||
|
||
@implicitNotFound("Cannot proof type inequality because types are equal: ${A} =:= ${B}") | ||
type =!:=[A, B] = NotGiven[A =:= B] | ||
|
||
object Test: | ||
summon[F[String]] // error | ||
summon[G[String]] // error | ||
summon[H[Int]] // error | ||
summon[H[Int][Float]] // error | ||
summon[AAA[Int]] // error | ||
summon[AAA[Int][Float]] // error | ||
summon[op.F[Int]] // error | ||
summon[String =!:= String] // error |