Skip to content

Commit

Permalink
Merge pull request #986 from joroKr21/varargs-witness
Browse files Browse the repository at this point in the history
Fix #843 - add regression test
  • Loading branch information
joroKr21 authored Mar 22, 2020
2 parents 9b2776c + 3e6959f commit 462399b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Empty file added :
Empty file.
16 changes: 16 additions & 0 deletions core/src/test/scala/shapeless/singletons.scala
Original file line number Diff line number Diff line change
Expand Up @@ -696,3 +696,19 @@ package UnrefineTest {
new Bar(Foo.from( LabelledGeneric[FooBar] )).modify(Symbol("y").narrow, (_: Int) * 2).keys
}
}

object VarArgsWitnessTest {
trait Base
class Dep[B <: Base with Singleton]
object instance extends Base
val dep = new Dep[instance.type]

def varargs[B <: Base with Singleton](el: Dep[B]*)(implicit w: Witness.Aux[B]): Unit = ()
def poly[B <: Base with Singleton](el1: Dep[B])(implicit w: Witness.Aux[B]): Unit = ()
def poly[B <: Base with Singleton](el1: Dep[B], el2: Dep[B])(implicit w: Witness.Aux[B]): Unit = ()

varargs(dep)
varargs(dep, dep)
poly(dep)
poly(dep, dep)
}

0 comments on commit 462399b

Please # to comment.