File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/core
tests/neg-custom-args/captures Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -788,7 +788,10 @@ 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 ) || isAllOf(InlineParam )
791
+ def isUnstableValue =
792
+ isOneOf(UnstableValueFlags )
793
+ || ! ctx.mode.is(Mode .InCaptureSet ) && info.isInstanceOf [ExprType ]
794
+ || isAllOf(InlineParam )
792
795
isType || is(StableRealizable ) || exists && ! isUnstableValue
793
796
}
794
797
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[" " ] = ??? // error
10
10
val x9 : String @ retains[foo] = ??? // error
11
11
()
You can’t perform that action at this time.
0 commit comments