Skip to content

Commit

Permalink
Regression test (#16005)
Browse files Browse the repository at this point in the history
This now works with level checking on instantiation

Fixes #15154
  • Loading branch information
odersky committed Sep 9, 2022
2 parents 968407a + e3173c3 commit 2bff208
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tests/new/test.scala

This file was deleted.

24 changes: 24 additions & 0 deletions tests/pos/i15154.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
trait RType
trait TypeEntry{
def typeAdapter: TypeAdapter[_] = ???
}

trait TypeAdapter[E]
case class OptionTypeAdapter[E](nullIsNone: Boolean, valueTypeAdapter: TypeAdapter[E]) extends TypeAdapter[E]
case class JavaOptionalTypeAdapter[E](nullIsNone: Boolean, valueTypeAdapter: TypeAdapter[E]) extends TypeAdapter[E]

def typeAdapterOf(concreteType: RType): TypeAdapter[_] = ???

@main def test() = {
// https://github.com/gzoller/scalajack/blob/4a29366e28fbd594d7c21b4eb969ca14626ac0d1/core/src/main/scala/co.blocke.scalajack/typeadapter/TupleTypeAdapter.scala#L21-L30
val seq = List.empty[RType]
seq map { f =>
typeAdapterOf(f) match {
case ota: OptionTypeAdapter[_] => ota.copy(nullIsNone = true)
case jota: JavaOptionalTypeAdapter[_] => jota.copy(nullIsNone = true)
case other => other
}
}
}

// 15154

0 comments on commit 2bff208

Please sign in to comment.