Skip to content

Commit 5a89d83

Browse files
committed
Disable ContextFunctionResults for erased contextual functions
1 parent 0bb8530 commit 5a89d83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object ContextFunctionResults:
2020
*/
2121
def annotateContextResults(mdef: DefDef)(using Context): Unit =
2222
def contextResultCount(rhs: Tree, tp: Type): Int = tp match
23-
case defn.ContextFunctionType(_, resTpe, _) =>
23+
case defn.ContextFunctionType(_, resTpe, isErased) if !isErased.contains(true) /* Only enable for non-erased functions */ =>
2424
rhs match
2525
case closureDef(meth) => 1 + contextResultCount(meth.rhs, resTpe)
2626
case _ => 0

0 commit comments

Comments
 (0)