File tree 2 files changed +24
-2
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -3768,8 +3768,12 @@ object Types extends TypeUtils {
3768
3768
3769
3769
override final def derivedSelect (tp : NamedType , pre : Type ): Type =
3770
3770
if tp.prefix eq pre then tp
3771
- else if tp.symbol.exists then NamedType (pre, tp.name, tp.denot.asSeenFrom(pre))
3772
- else NamedType (pre, tp.name)
3771
+ else
3772
+ pre match
3773
+ case ref : ParamRef if (ref.binder eq self) && tp.symbol.exists =>
3774
+ NamedType (pre, tp.name, tp.denot.asSeenFrom(pre))
3775
+ case _ =>
3776
+ tp.derivedSelect(pre)
3773
3777
3774
3778
final def derivedLambdaType (paramNames : List [ThisName ] = this .paramNames,
3775
3779
paramInfos : List [PInfo ] = this .paramInfos,
Original file line number Diff line number Diff line change
1
+ def Test = {
2
+ val ops : CompileOps [Option , Option , Any ] = ???
3
+ ops.to(List ).map(_.reverse) // error
4
+ }
5
+
6
+ trait CompileOps [F [_], G [_], O ]:
7
+ def to (collector : Collector [O ]): G [collector.Out ]
8
+ trait Collector [- A ] {
9
+ type Out
10
+ }
11
+
12
+ object Collector :
13
+ type Aux [A , X ] = Collector [A ] { type Out = X }
14
+
15
+ given [A , C [_]]: Conversion [
16
+ scala.collection.IterableFactory [C ],
17
+ Collector .Aux [A , C [A ]]
18
+ ] = ???
You can’t perform that action at this time.
0 commit comments