Skip to content

Commit bc574e5

Browse files
committed
Fix some test
1 parent a7e2fbd commit bc574e5

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

compiler/src/dotty/tools/dotc/cc/RetainingType.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)] =

tests/neg-custom-args/captures/cc-this3.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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
| where: ^ refers to the universal root capability
88
|
99
| 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
1212
| ^
1313
| illegal inheritance: self type C^{C.this.f} of class C does not conform to self type A^{}
1414
| of parent class A

tests/neg-custom-args/captures/cc-this3.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import language.experimental.captureChecking
12
class Cap extends caps.Capability
23

34
def eff(using Cap): Unit = ()

tests/pos-custom-args/captures/cc-expand.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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] = ???

0 commit comments

Comments
 (0)