-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workaround for a possible scala bug in show for value class. (#1804)
* workaround for a possible scala bug * renamed to cshow * hand rolling type class boilerplate * minor * move tests to scala 2.11+ to avoid 6260 in 2.10
- Loading branch information
1 parent
3238de6
commit 41402a8
Showing
4 changed files
with
55 additions
and
8 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
25 changes: 25 additions & 0 deletions
25
tests/src/test/scala-2.11+/cats/tests/RegressionTests.scala
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,25 @@ | ||
package cats | ||
package tests | ||
|
||
|
||
import ExtraRegressionTests._ | ||
|
||
class ExtraRegressionTests extends CatsSuite { | ||
/** | ||
* Placed here to work around scala/bug#6260 on scala 2.10 | ||
*/ | ||
test("#1802 duplicated method name") { | ||
Show[First[String]] | ||
} | ||
} | ||
|
||
|
||
object ExtraRegressionTests { | ||
final case class First[A](getFirst: A) extends AnyVal | ||
object First { | ||
implicit def showInstance[A](implicit ev: Show[A]): Show[First[A]] = new Show[First[A]] { | ||
override def show(f: First[A]): String = s"First(${ev.show(f.getFirst)})" | ||
} | ||
} | ||
|
||
} |
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