Skip to content

Commit d3c1c4e

Browse files
authored
Test case for issue 16311 (#16317)
Closes #16311
2 parents d8a6751 + 3c88376 commit d3c1c4e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/pos-deep-subtype/i16311.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
trait Tagged[U]
2+
type WithTag[+T, U] = T & Tagged[U]
3+
4+
trait FromInput[Val]
5+
implicit def coercedScalaInput[T]: FromInput[WithTag[T, Int]] = ???
6+
implicit def optionInput[T](implicit ev: FromInput[T]): FromInput[Option[T]] = ???
7+
8+
trait WithoutInputTypeTags[T]
9+
implicit def coercedOptArgTpe[T]: WithoutInputTypeTags[Option[WithTag[T, Int]]] = ???
10+
11+
trait InputType[+T]
12+
class OptionInputType[T](ofType: InputType[T]) extends InputType[Option[T]]
13+
14+
type Argument[T]
15+
def argument[T](argumentType: InputType[T])(implicit fromInput: FromInput[T], res: WithoutInputTypeTags[T]): Argument[Option[T]] = ???
16+
17+
def test = argument(OptionInputType(??? : InputType[WithTag[Boolean, Int]]))

0 commit comments

Comments
 (0)