Skip to content

Commit 208c8c4

Browse files
committed
Use isFunctionNType instead of isNonRefinedFunction for AppliedTypes
1 parent 749b07c commit 208c8c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ object CaptureSet:
882882
++ (recur(rinfo.resType) // add capture set of result
883883
-- CaptureSet(rinfo.paramRefs.filter(_.isTracked)*)) // but disregard bound parameters
884884
case tpd @ AppliedType(tycon, args) =>
885-
if followResult && defn.isNonRefinedFunction(tpd) then
885+
if followResult && defn.isFunctionNType(tpd) then
886886
recur(args.last)
887887
// must be (pure) FunctionN type since ImpureFunctions have already
888888
// been eliminated in selector's dealias. Use capture set of result.

compiler/src/dotty/tools/dotc/cc/Setup.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extends tpd.TreeTraverser:
4949
def recur(tp: Type): Type = tp.dealias match
5050
case tp @ CapturingType(parent, refs) if !tp.isBoxed =>
5151
tp.boxed
52-
case tp1 @ AppliedType(tycon, args) if defn.isNonRefinedFunction(tp1) =>
52+
case tp1 @ AppliedType(tycon, args) if defn.isFunctionNType(tp1) =>
5353
val res = args.last
5454
val boxedRes = recur(res)
5555
if boxedRes eq res then tp
@@ -129,7 +129,7 @@ extends tpd.TreeTraverser:
129129
apply(parent)
130130
case tp @ AppliedType(tycon, args) =>
131131
val tycon1 = this(tycon)
132-
if defn.isNonRefinedFunction(tp) then
132+
if defn.isFunctionNType(tp) then
133133
// Convert toplevel generic function types to dependent functions
134134
if !defn.isFunctionSymbol(tp.typeSymbol) && (tp.dealias ne tp) then
135135
// This type is a function after dealiasing, so we dealias and recurse.

0 commit comments

Comments
 (0)