Skip to content

Commit 2de8fbf

Browse files
committed
Disable tracked by default, mark accessors as tracked, when infering tracked
1 parent 71e2cd8 commit 2de8fbf

File tree

4 files changed

+5
-88
lines changed

4 files changed

+5
-88
lines changed

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ object Feature:
113113
* feature is defined.
114114
*/
115115
def enabled(feature: TermName)(using Context): Boolean =
116-
enabledBySetting(feature) || enabledByImport(feature) || feature == tracked
116+
enabledBySetting(feature) || enabledByImport(feature)
117117

118118
/** Is auto-tupling enabled? */
119119
def autoTuplingEnabled(using Context): Boolean = !enabled(nme.noAutoTupling)

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,14 +1931,14 @@ class Namer { typer: Typer =>
19311931
def wrapRefinedMethType(restpe: Type): Type =
19321932
wrapMethType(addParamRefinements(restpe, paramSymss))
19331933

1934-
def addTrackedIfNeeded(ddef: DefDef, owningSym: Symbol): Boolean =
1935-
var wasSet = false
1934+
def addTrackedIfNeeded(ddef: DefDef, owningSym: Symbol): Unit =
19361935
for params <- ddef.termParamss; param <- params do
19371936
val psym = symbolOfTree(param)
19381937
if needsTracked(psym, param, owningSym) then
19391938
psym.setFlag(Tracked)
1940-
wasSet = true
1941-
wasSet
1939+
for acc <- sym.maybeOwner.infoOrCompleter.decls.lookupAll(psym.name) if acc.is(ParamAccessor) do
1940+
acc.resetFlag(PrivateLocal)
1941+
acc.setFlag(Tracked)
19421942

19431943
if Feature.trackedEnabled then addTrackedIfNeeded(ddef, sym.maybeOwner)
19441944

tests/pos/infer-tracked-parsercombinators-givens.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ given apply: [C, E] => Combinator[Apply[C, E]] {
2626
}
2727
}
2828

29-
// TODO(kπ) infer tracked correctly here
3029
given combine[A, B](using
3130
tracked val f: Combinator[A],
3231
tracked val s: Combinator[B] { type Context = f.Context }

tests/pos/infer-tracked-vector.scala

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)