File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
compiler/src/dotty/tools/dotc/cc
tests/pos-custom-args/captures Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -331,8 +331,7 @@ extension (tp: Type)
331331 def boxed (using Context ): Type = tp.dealias match
332332 case tp @ CapturingType (parent, refs) if ! tp.isBoxed && ! refs.isAlwaysEmpty =>
333333 tp.annot match
334- case ann : CaptureAnnotation =>
335- assert(! parent.derivesFrom(defn.Caps_CapSet ))
334+ case ann : CaptureAnnotation if ! parent.derivesFrom(defn.Caps_CapSet ) =>
336335 AnnotatedType (parent, ann.boxedAnnot)
337336 case ann => tp
338337 case tp : RealTypeBounds =>
Original file line number Diff line number Diff line change 1+ import language .experimental .captureChecking
2+ import caps .cap
3+
4+ trait Ctx [T >: Nothing <: Any ]() extends Object
5+
6+ def test : Unit =
7+ {
8+ val x : Any ^ {cap} = ???
9+ val y : Any ^ {cap} = ???
10+ object O {
11+ val z : Any ^ {cap} = ???
12+ }
13+ val baz3 :
14+ Int -> [C >: caps.CapSet <: caps.CapSet ^ ,
15+ D >: caps.CapSet <: caps.CapSet ^ {C ^ }, E >: caps.CapSet <:
16+ caps.CapSet ^ {C ^ , x}] => () -> [F >: caps.CapSet ^ {x, y} <:
17+ caps.CapSet ^ {C ^ , E ^ }] => (x : Int ) -> (Ctx [F ]) ?-> Int
18+ = (i : Int ) => [
19+ C >: _root_.scala.caps.CapSet <: _root_.scala.caps.CapSet ^ {cap},
20+ D >: _root_.scala.caps.CapSet <: _root_.scala.caps.CapSet ^ {C ^ },
21+ E >: _root_.scala.caps.CapSet <: _root_.scala.caps.CapSet ^ {C ^ , x}] =>
22+ () => [
23+ F
24+ >: _root_.scala.caps.CapSet ^ {x, y} <:
25+ _root_.scala.caps.CapSet ^ {C ^ , E ^ }
26+ ] => (x : Int ) => (ev : Ctx [F ]) ?=> 1
27+ ()
28+ }
You can’t perform that action at this time.
0 commit comments