Skip to content

Commit 4cadfb0

Browse files
committed
update given syntax in tests
1 parent 60d1c2d commit 4cadfb0

18 files changed

+28
-28
lines changed

scala3doc-testcases/src/tests/givenDRI.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ trait A[T]
44
trait B[T]
55
trait C
66

7-
given A[Int]
7+
given A[Int] with {}
88

9-
given A[String]
9+
given A[String] with {}
1010

11-
given A[Seq[String]]
11+
given A[Seq[String]] with {}
1212

1313
given [T: A]: A[Option[T]] with {}
1414

1515
given [T: B]: A[T] with {}
1616

1717
given [C]: A[C] with {}
1818

19-
given A[C]
19+
given A[C] with {}
2020

2121
given [S <: C]: A[S] with {}
2222

scala3doc-testcases/src/tests/inheritedMembers1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class A
1010
= ???
1111
object X
1212
trait Z
13-
given B
13+
given B with {}
1414
type I = Int
1515
/*<-*/extension (a: A) /*->*/def extension: String
1616
= ???

tests/neg-macros/i7919.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ object Test {
88
'{ "in staged" }
99
}
1010

11-
given Expr[Int] // error
11+
given Expr[Int] with {} // error
1212
new Expr[Int] // error
1313
class Expr2 extends Expr[Int] // error
1414

15-
given Type[Int] // error
15+
given Type[Int] with {} // error
1616
new Type[Int] // error
1717
class Type2 extends Type[Int] // error
1818

tests/neg/empty-given.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
given {
1+
given { // error
22
def foo = 1 // error
3-
}
3+
} // error

tests/neg/i5978.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object TextParser {
88
given TP: TokenParser[Char, Position[CharSequence]] with {}
99

1010
given FromCharToken(using T: TokenParser[Char, Position[CharSequence]])
11-
as Conversion[Char, Position[CharSequence]] = ???
11+
: Conversion[Char, Position[CharSequence]] = ???
1212
}
1313

1414
object Testcase {

tests/neg/transparent.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ transparent class c // error
55
transparent object y // error
66
transparent trait t // ok
77
transparent type T = c // error
8-
transparent given c // error
8+
transparent given c with {} // error
99

tests/pos-custom-args/erased/i7868.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object Coproduct {
1818

1919
given atTail[Head, Tail, Value, NextIndex <: Int]
2020
(using atNext: At[Tail, Value, NextIndex])
21-
as At[Head +: Tail, Value, S[NextIndex]]:
21+
: At[Head +: Tail, Value, S[NextIndex]] with
2222
val cast: Value <:< Head +: Tail = atNext.cast
2323

2424
given [A](using A): (() => A) = { () => summon[A]}

tests/pos/i5978.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package p1 {
1616

1717
// skipping newlines is OK here
1818

19-
as Conversion[Char, Position[CharSequence]] = ???
19+
: Conversion[Char, Position[CharSequence]] = ???
2020
}
2121

2222
object Testcase {

tests/pos/i6716.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
trait Monad[T]
22
class Foo
33
object Foo {
4-
given Monad[Foo]
4+
given Monad[Foo] with {}
55
}
66

77
opaque type Bar = Foo

tests/pos/i6864.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
class A
22
class B
33

4-
given A
5-
given B
4+
given A with {}
5+
given B with {}
66

77
trait Foo
88
trait Bar
99

10-
given Foo
11-
given Bar
10+
given Foo with {}
11+
given Bar with {}
1212

1313
trait C
1414
trait Baz[A]
1515

16-
given C
16+
given C with {}
1717
given [A]: Baz[A] with {}

0 commit comments

Comments
 (0)