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:
16
16
17
17
def apply (tp : Type , typeRefs : Type , byName : Boolean = false )(using Context ): Type =
18
18
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 )
20
20
AnnotatedType (tp, Annotation (annotTree))
21
21
22
22
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
3
3
| ^
4
4
| illegal inheritance: self type B^ of class B does not conform to self type A^{}
5
5
| of parent class A
6
6
|
7
7
| where: ^ refers to the universal root capability
8
8
|
9
9
| longer explanation available when compiling with `-explain`
10
- -- [E058] Type Mismatch Error: tests/neg-custom-args/captures/cc-this3.scala:11 :6 --------------------------------------
11
- 11 |class C(val f: () => Int) extends A // error
10
+ -- [E058] Type Mismatch Error: tests/neg-custom-args/captures/cc-this3.scala:12 :6 --------------------------------------
11
+ 12 |class C(val f: () => Int) extends A // error
12
12
| ^
13
13
| illegal inheritance: self type C^{C.this.f} of class C does not conform to self type A^{}
14
14
| of parent class A
Original file line number Diff line number Diff line change
1
+ import language .experimental .captureChecking
1
2
class Cap extends caps.Capability
2
3
3
4
def eff (using Cap ): Unit = ()
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ object Test:
11
11
12
12
def x0 : A -> B ^ {ct} = ???
13
13
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 ] = ???
17
17
18
- def x4 : (x : A @ retains(ct) ) -> B -> C = ???
18
+ def x4 : (x : A @ retains[ct. type ] ) -> B -> C = ???
19
19
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 ] = ???
21
21
def x6 : A -> (x : B @ retains[ct.type ]) -> (() -> C @ retains[dt.type ]) @ retains[x.type | dt.type ] = ???
22
22
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