Skip to content

Commit

Permalink
Treat 3.5-migration the same as 3.5 for a warning
Browse files Browse the repository at this point in the history
Treat 3.5-migration the same as 3.5 for a warning about implicit priority change

Fixes #20420
  • Loading branch information
odersky committed May 19, 2024
1 parent a7ac03e commit a499883
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/warn/i20420.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//> using options -source 3.5-migration

final class StrictEqual[V]
final class Less[V]
type LessEqual[V] = Less[V] | StrictEqual[V]

object TapirCodecIron:
trait ValidatorForPredicate[Value, Predicate]
trait PrimitiveValidatorForPredicate[Value, Predicate]
extends ValidatorForPredicate[Value, Predicate]

given validatorForLessEqual[N: Numeric, NM <: N](using
ValueOf[NM]
): PrimitiveValidatorForPredicate[N, LessEqual[NM]] = ???
given validatorForDescribedOr[N, P](using
IsDescription[P]
): ValidatorForPredicate[N, P] = ???

trait IsDescription[A]
object IsDescription:
given derived[A]: IsDescription[A] = ???

@main def Test = {
import TapirCodecIron.{*, given}
type IntConstraint = LessEqual[3]
summon[ValidatorForPredicate[Int, IntConstraint]] // warn
}

0 comments on commit a499883

Please sign in to comment.