File tree 2 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -793,7 +793,7 @@ object ProtoTypes {
793
793
else mt.derivedLambdaType(mt.paramNames, mt.paramInfos, rt)
794
794
case _ =>
795
795
val ft = defn.FunctionOf (mt.paramInfos, rt)
796
- if ( mt.paramInfos.nonEmpty || ft <:< pt) ft else rt
796
+ if mt.paramInfos.nonEmpty || ( ft frozen_ <:< pt) then ft else rt
797
797
}
798
798
}
799
799
case et : ExprType =>
Original file line number Diff line number Diff line change
1
+ case class Expr [+ T ](get : T )
2
+ trait Ctx [F [_]]
3
+ sealed trait Selector [F [_]]:
4
+ def appended (base : Expr [SelectLoop [F ]]): Expr [SelectLoop [F ]]
5
+
6
+ // Without Ctx[F] argument it would compile correctly
7
+ class SelectLoop [F [_]](using Ctx [F ])
8
+ object SelectLoop :
9
+ def loopImpl [F [_]](ctx : Ctx [F ])(caseDefs : List [Selector [F ]]): Expr [Unit ] =
10
+ // Adding explicit type :Expr[SelectLoop[F]] satifies the compiler
11
+ val s0 = Expr (new SelectLoop [F ](using ctx))
12
+ val g = caseDefs.foldRight(s0)(_.appended(_))
13
+ Expr (())
You can’t perform that action at this time.
0 commit comments