Skip to content

Commit

Permalink
Merge branch 'master' into add_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joroKr21 authored Jul 30, 2020
2 parents ef76eaf + 0687c03 commit eb2b43c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jdk:

scala:
- 2.11.12
- 2.12.11
- 2.12.12
- 2.13.3

env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ releases][olderusage] on the shapeless wiki.
## Building shapeless

shapeless is built with SBT 1.3.10 or later, and its master branch is built with Scala 2.13.2 by default but also
cross-builds for 2.11.12 and 2.12.11.
cross-builds for 2.11.12 and 2.12.12.

[namehashing]: https://github.com/sbt/sbt/issues/1640

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}
import sbtcrossproject.CrossProject

val Scala211 = "2.11.12"
val Scala212 = "2.12.11"
val Scala212 = "2.12.12"
val Scala213 = "2.13.3"

val isScalaNative = System.getenv("SCALA_NATIVE") != null
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/shapeless/generic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ class GenericMacros(val c: whitebox.Context) extends CaseClassMacros {
val (p, ts) = ctorDtor.binding
val to = cq"$p => ${mkHListValue(ts)}.asInstanceOf[$repr]"
val (rp, rts) = ctorDtor.reprBinding
val from = cq"$rp => ${ctorDtor.construct(rts)}"
val from = cq"$rp => ${ctorDtor.construct(rts)}.asInstanceOf[$tpe]"
q"$generic.instance[$tpe, $repr]({ case $to }, { case $from })"
}

Expand Down
22 changes: 22 additions & 0 deletions core/src/test/scala_2.13+/shapeless/LabelledGenericTests213.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package shapeless

import org.junit.Assert._
import org.junit.Test
import shapeless.ops.record.Selector

class LabelledGenericTests213 {
import LabelledGenericTests213._

@Test
def testSelectorWithHkt(): Unit = {
assertEquals(0, new Func[Hkt[Option]].select("foo"))
assertEquals(0, new Func[Hkt[Id]].select("foo"))
}
}

object LabelledGenericTests213 {
case class Hkt[F[_]](foo: F[String])
class Func[T] {
def select[R <: HList](k: Witness)(implicit gen: LabelledGeneric.Aux[T, R], selector: Selector[R, k.T]) = 0
}
}

0 comments on commit eb2b43c

Please sign in to comment.