File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed
compiler/src/dotty/tools/dotc/cc Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ object RetainingType:
1616
1717 def apply (tp : Type , typeRefs : Type , byName : Boolean = false )(using Context ): Type =
1818 val annotCls = if byName then defn.RetainsByNameAnnot else defn.RetainsAnnot
19- val annotTree = New (AppliedType (annotCls.typeRef, defn. NothingType :: Nil ), Nil )
19+ val annotTree = New (AppliedType (annotCls.typeRef, typeRefs :: Nil ), Nil )
2020 AnnotatedType (tp, Annotation (annotTree))
2121
2222 def unapply (tp : AnnotatedType )(using Context ): Option [(Type , Type )] =
Original file line number Diff line number Diff line change 1- -- [E058] Type Mismatch Error: tests/neg-custom-args/captures/cc-this3.scala:8 :6 ---------------------------------------
2- 8 |class B extends A: // error
1+ -- [E058] Type Mismatch Error: tests/neg-custom-args/captures/cc-this3.scala:9 :6 ---------------------------------------
2+ 9 |class B extends A: // error
33 | ^
44 | illegal inheritance: self type B^ of class B does not conform to self type A^{}
55 | of parent class A
66 |
77 | longer explanation available when compiling with `-explain`
8- -- [E058] Type Mismatch Error: tests/neg-custom-args/captures/cc-this3.scala:11 :6 --------------------------------------
9- 11 |class C(val f: () => Int) extends A // error
8+ -- [E058] Type Mismatch Error: tests/neg-custom-args/captures/cc-this3.scala:12 :6 --------------------------------------
9+ 12 |class C(val f: () => Int) extends A // error
1010 | ^
1111 | illegal inheritance: self type C^{C.this.f} of class C does not conform to self type A^{}
1212 | of parent class A
Original file line number Diff line number Diff line change 1+ import language .experimental .captureChecking
12class Cap extends caps.Capability
23
34def eff (using Cap ): Unit = ()
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ object Test:
1111
1212 def x0 : A -> B ^ {ct} = ???
1313
14- def x1 : A -> B @ retains(ct) = ???
15- def x2 : A -> B -> C @ retains(ct) = ???
16- def x3 : A -> () -> B -> C @ retains(ct) = ???
14+ def x1 : A -> B @ retains[ct. type ] = ???
15+ def x2 : A -> B -> C @ retains[ct. type ] = ???
16+ def x3 : A -> () -> B -> C @ retains[ct. type ] = ???
1717
18- def x4 : (x : A @ retains(ct) ) -> B -> C = ???
18+ def x4 : (x : A @ retains[ct. type ] ) -> B -> C = ???
1919
20- def x5 : A -> (x : B @ retains[ct.type ]) -> () -> C @ retains(dt) = ???
20+ def x5 : A -> (x : B @ retains[ct.type ]) -> () -> C @ retains[dt. type ] = ???
2121 def x6 : A -> (x : B @ retains[ct.type ]) -> (() -> C @ retains[dt.type ]) @ retains[x.type | dt.type ] = ???
2222 def x7 : A -> (x : B @ retains[ct.type ]) -> (() -> C @ retains[dt.type ]) @ retains[x.type ] = ???
You can’t perform that action at this time.
0 commit comments