Skip to content

Fix #8392: Remove parameter type bounds from scala.compiletime.ops.any types #8723

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

Merged
merged 1 commit into from
Apr 15, 2020
Merged
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
4 changes: 2 additions & 2 deletions library/src/scala/compiletime/ops/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package object ops {
* val eq3: "1" == "1" = true
* ```
*/
@infix type ==[X <: AnyVal, Y <: AnyVal] <: Boolean
@infix type ==[X, Y] <: Boolean

/** Inequality comparison of two singleton types.
* ```scala
Expand All @@ -20,7 +20,7 @@ package object ops {
* val eq3: "1" != "1" = false
* ```
*/
@infix type !=[X <: AnyVal, Y <: AnyVal] <: Boolean
@infix type !=[X, Y] <: Boolean
}

object string {
Expand Down
20 changes: 20 additions & 0 deletions tests/neg/singleton-ops-any.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- [E007] Type Mismatch Error: tests/neg/singleton-ops-any.scala:6:23 --------------------------------------------------
6 | val t34: 10 == "5" = true // error
| ^^^^
| Found: (true : Boolean)
| Required: (false : Boolean)
-- [E007] Type Mismatch Error: tests/neg/singleton-ops-any.scala:7:22 --------------------------------------------------
7 | val t35: 10 == 10 = false // error
| ^^^^^
| Found: (false : Boolean)
| Required: (true : Boolean)
-- [E007] Type Mismatch Error: tests/neg/singleton-ops-any.scala:12:24 -------------------------------------------------
12 | val t38: false != 5 = false // error
| ^^^^^
| Found: (false : Boolean)
| Required: (true : Boolean)
-- [E007] Type Mismatch Error: tests/neg/singleton-ops-any.scala:13:22 -------------------------------------------------
13 | val t39: 10 != 10 = true // error
| ^^^^
| Found: (true : Boolean)
| Required: (false : Boolean)
1 change: 1 addition & 0 deletions tests/neg/singleton-ops-any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ object Test {
val t33: 0 == false = false
val t34: 10 == "5" = true // error
val t35: 10 == 10 = false // error
val t35string: "10" == "10" = true

val t36: 1 != 1 = false
val t37: 0 != 1 = true
Expand Down