Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f38d926

Browse files
committed
Turn level checking off for DerivedVars
1 parent a8d6cbf commit f38d926

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,11 @@ object CaptureSet:
828828

829829
def levelOK(elem: Capability)(using Context): Boolean = elem match
830830
case elem @ ResultCap(binder) =>
831-
rootLimit == null && (this.isInstanceOf[BiMapped] ||isPartOf(binder.resType))
831+
rootLimit == null && isPartOf(binder.resType)
832832
case GlobalCap =>
833833
rootLimit == null
834834
case elem: ParamRef =>
835-
this.isInstanceOf[BiMapped] ||isPartOf(elem.binder.resType)
835+
isPartOf(elem.binder.resType)
836836
case _ =>
837837
if owner.exists then
838838
val elemVis = elem.visibility
@@ -950,6 +950,9 @@ object CaptureSet:
950950
abstract class DerivedVar(owner: Symbol, initialElems: Refs)(using @constructorOnly ctx: Context)
951951
extends Var(owner, initialElems):
952952

953+
override def levelOK(elem: Capability)(using Context): Boolean =
954+
true
955+
953956
// For debugging: A trace where a set was created. Note that logically it would make more
954957
// sense to place this variable in Mapped, but that runs afoul of the initialization checker.
955958
// val stack = if debugSets && this.isInstanceOf[Mapped] then (new Throwable).getStackTrace().take(20) else null

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /