File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1581,7 +1581,7 @@ trait Applications extends Compatibility {
1581
1581
val newAcc =
1582
1582
params match
1583
1583
case param :: _ if param.isType => true
1584
- case param :: _ if param.isTerm && ! param.isOneOf( GivenOrImplicit ) => false
1584
+ case param :: _ if param.isTerm && ! param.is( Given ) => false
1585
1585
case _ => acc
1586
1586
hasTrailingTypeParams(paramss.tail, newAcc)
1587
1587
Original file line number Diff line number Diff line change
1
+ def summonsTest =
2
+ given Type [String ] = ???
3
+ val opt1 : Option [Wrapper [String ]] = Wrapper .unapply[String ] // ok
4
+ val opt2 = Wrapper .unapply[String ]
5
+ opt2.map(_.getValue)
6
+
7
+ def patternMatchTest =
8
+ Type [String ] match
9
+ case Wrapper (v) => v.getValue // was an error
10
+
11
+ type Type [A ] = Class [A ] // any rhs would work here
12
+ object Type :
13
+ def apply [A ]: Type [A ] = ???
14
+
15
+ trait Wrapper [T ]:
16
+ def getValue : T = ???
17
+ object Wrapper :
18
+ def unapply [T ](implicit ev : Type [T ]): Option [Wrapper [T ]] = None
You can’t perform that action at this time.
0 commit comments