File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
compiler/src/dotty/tools/dotc/core
tests/pos-custom-args/captures Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -4999,9 +4999,9 @@ object Types {
4999
4999
if (! givenSelf.isValueType) appliedRef
5000
5000
else if (clsd.is(Module )) givenSelf
5001
5001
else if (ctx.erasedTypes) appliedRef
5002
- else givenSelf match
5003
- case givenSelf @ EventuallyCapturingType (tp, _) =>
5004
- givenSelf .derivedAnnotatedType(tp & appliedRef, givenSelf .annot)
5002
+ else givenSelf.dealiasKeepAnnots match
5003
+ case givenSelf1 @ EventuallyCapturingType (tp, _) =>
5004
+ givenSelf1 .derivedAnnotatedType(tp & appliedRef, givenSelf1 .annot)
5005
5005
case _ =>
5006
5006
AndType (givenSelf, appliedRef)
5007
5007
}
Original file line number Diff line number Diff line change
1
+ import language .experimental .captureChecking
2
+
3
+ type AnyIterableOnce [A ] = IterableOnce [A ]^
4
+
5
+ /** Iterator can be used only once */
6
+ trait IterableOnce [+ A ]:
7
+ // this: IterableOnce[A]{ref any} =>
8
+ this : AnyIterableOnce [A ] =>
9
+ def iterator : Iterator [A ]^ {this }
You can’t perform that action at this time.
0 commit comments