File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
compiler/src/dotty/tools/dotc
tests/neg-custom-args/captures Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -83,15 +83,13 @@ extension (tp: Type)
83
83
tp1.reach :: Nil
84
84
case ReadOnlyCapability (tp1) =>
85
85
tp1.readOnly :: Nil
86
- case tp : CaptureRef if tp.isTrackableRef =>
87
- tp :: Nil
88
- case tp : TypeRef if tp.symbol.isType && tp.derivesFrom(defn.Caps_CapSet ) =>
89
- tp :: Nil
86
+ case tp : CaptureRef =>
87
+ if tp.isNothingType then Nil
88
+ else tp :: Nil // should be checked by wellformedness
90
89
case OrType (tp1, tp2) =>
91
90
tp1.retainedElements ++ tp2.retainedElements
92
91
case _ =>
93
- if tp.isNothingType then Nil
94
- else throw IllegalCaptureRef (tp)
92
+ throw IllegalCaptureRef (tp)
95
93
96
94
/** Is this type a CaptureRef that can be tracked?
97
95
* This is true for
Original file line number Diff line number Diff line change @@ -788,7 +788,7 @@ object SymDenotations {
788
788
* So the first call to a stable member might fail and/or produce side effects.
789
789
*/
790
790
final def isStableMember (using Context ): Boolean = {
791
- def isUnstableValue = isOneOf(UnstableValueFlags ) || info. isInstanceOf [ ExprType ] || isAllOf(InlineParam )
791
+ def isUnstableValue = isOneOf(UnstableValueFlags ) || isAllOf(InlineParam )
792
792
isType || is(StableRealizable ) || exists && ! isUnstableValue
793
793
}
794
794
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ object foo
6
6
7
7
def test (c : Cap , other : String ): Unit =
8
8
val x7 : String ^ {c} = ??? // OK
9
- val x8 : String @ retains[x7 + x7] = ??? // error
9
+ val x8 : String @ retains[( x7 + x7) ] = ??? // error
10
10
val x9 : String @ retains[foo] = ??? // error
11
11
()
You can’t perform that action at this time.
0 commit comments