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 @@ -3858,8 +3858,12 @@ object Types extends TypeUtils {
3858
3858
3859
3859
override final def derivedSelect (tp : NamedType , pre : Type ): Type =
3860
3860
if tp.prefix eq pre then tp
3861
- else if tp.symbol.exists then NamedType (pre, tp.name, tp.denot.asSeenFrom(pre))
3862
- else NamedType (pre, tp.name)
3861
+ else
3862
+ pre match
3863
+ case ref : ParamRef if (ref.binder eq self) && tp.symbol.exists =>
3864
+ NamedType (pre, tp.name, tp.denot.asSeenFrom(pre))
3865
+ case _ =>
3866
+ tp.derivedSelect(pre)
3863
3867
3864
3868
final def derivedLambdaType (paramNames : List [ThisName ] = this .paramNames,
3865
3869
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