Skip to content

Commit 082214e

Browse files
committed
Make the unboxed parameter scheme standard
Drop the config option that enables it.
1 parent 5a35160 commit 082214e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ object ccConfig:
4040
*/
4141
inline val handleEtaExpansionsSpecially = false
4242

43-
val useUnboxedParams = true
44-
4543
/** If true, use existential capture set variables */
4644
def useExistentials(using Context) =
4745
Feature.sourceVersion.stable.isAtLeast(SourceVersion.`3.5`)

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,8 @@ class CheckCaptures extends Recheck, SymTransformer:
402402
// by their underlying capture set, which cannot be universal.
403403
// Reach capabilities of @unboxed parameters are exempted.
404404
val cs = CaptureSet.ofInfo(c)
405-
if ccConfig.useUnboxedParams then
406-
cs.disallowRootCapability: () =>
407-
report.error(em"Local reach capability $c leaks into capture scope of ${env.ownerString}", pos)
405+
cs.disallowRootCapability: () =>
406+
report.error(em"Local reach capability $c leaks into capture scope of ${env.ownerString}", pos)
408407
checkSubset(cs, env.captured, pos, provenance(env))
409408
isVisible
410409
case ref: ThisType => isVisibleFromEnv(ref.cls)
@@ -547,7 +546,7 @@ class CheckCaptures extends Recheck, SymTransformer:
547546
protected override
548547
def recheckArg(arg: Tree, formal: Type)(using Context): Type =
549548
val argType = recheck(arg, formal)
550-
if unboxedArgs.contains(arg) && ccConfig.useUnboxedParams then
549+
if unboxedArgs.contains(arg) then
551550
capt.println(i"charging deep capture set of $arg: ${argType} = ${argType.deepCaptureSet}")
552551
markFree(argType.deepCaptureSet, arg.srcPos)
553552
argType

0 commit comments

Comments
 (0)