From b82e1c2cb156491728f4c23fa8e97b2c72ea9e1f Mon Sep 17 00:00:00 2001 From: odersky Date: Thu, 10 Nov 2022 19:03:16 +0100 Subject: [PATCH 1/2] Test case Closes #16311 --- tests/pos/i16311.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/pos/i16311.scala diff --git a/tests/pos/i16311.scala b/tests/pos/i16311.scala new file mode 100644 index 000000000000..d3e110860545 --- /dev/null +++ b/tests/pos/i16311.scala @@ -0,0 +1,17 @@ +trait Tagged[U] +type WithTag[+T, U] = T & Tagged[U] + +trait FromInput[Val] +implicit def coercedScalaInput[T]: FromInput[WithTag[T, Int]] = ??? +implicit def optionInput[T](implicit ev: FromInput[T]): FromInput[Option[T]] = ??? + +trait WithoutInputTypeTags[T] +implicit def coercedOptArgTpe[T]: WithoutInputTypeTags[Option[WithTag[T, Int]]] = ??? + +trait InputType[+T] +class OptionInputType[T](ofType: InputType[T]) extends InputType[Option[T]] + +type Argument[T] +def argument[T](argumentType: InputType[T])(implicit fromInput: FromInput[T], res: WithoutInputTypeTags[T]): Argument[Option[T]] = ??? + +def test = argument(OptionInputType(??? : InputType[WithTag[Boolean, Int]])) From 3c883768d41683cb2d9a7bddf3628e1e4b0e1bfd Mon Sep 17 00:00:00 2001 From: odersky Date: Thu, 10 Nov 2022 20:35:31 +0100 Subject: [PATCH 2/2] Move test to proper place need to allow deep subtype checking --- tests/{pos => pos-deep-subtype}/i16311.scala | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{pos => pos-deep-subtype}/i16311.scala (100%) diff --git a/tests/pos/i16311.scala b/tests/pos-deep-subtype/i16311.scala similarity index 100% rename from tests/pos/i16311.scala rename to tests/pos-deep-subtype/i16311.scala