Skip to content

Commit 1a6c5c5

Browse files
committed
Add and Fix tests
1 parent d59a3e6 commit 1a6c5c5

23 files changed

+273
-45
lines changed

scaladoc-testcases/src/tests/extensionParams.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,3 @@ extension (using String)(using Unit)(a: Animal)(using Int)(using Number)
5656
= ???
5757
def f14[D](b: D)[T](c: T): T
5858
= ???
59-

scaladoc-testcases/src/tests/methodsAndConstructors.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,3 @@ class Methods:
6262

6363
def clauseInterleaving[T](x: T)[U](y: U)(using (T, U)): (T, U)
6464
= ???
65-

tests/neg/extension-methods.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ object Test {
1515
def f2[T]: T = ??? // error: T is already defined as type T
1616
def f3(xs: List[T]) = ??? // error: xs is already defined as value xs
1717
}
18-
}
18+
}

tests/neg/interleaving-ab.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
object Ab:
2-
given String = ""
3-
given Double = 0
2+
given String = ""
3+
given Double = 0
44

5-
def illegal[A][B](x: A)(using B): B = summon[B] // error: Type parameter lists must be separated by a term or using parameter list
6-
7-
def ab[A](x: A)[B](using B): B = summon[B]
8-
def test =
9-
ab[Int](0: Int) // error
5+
def illegal[A][B](x: A)(using B): B = summon[B] // error: Type parameter lists must be separated by a term or using parameter list
6+
7+
def ab[A](x: A)[B](using B): B = summon[B]
8+
def test =
9+
ab[Int](0: Int) // error

tests/neg/interleaving-nameCollision.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/neg/interleaving-params.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ class Params{
44
def bbb[T <: U](x: U)[U]: U = ??? // error // error
55
def f0[T](implicit x: T)[U](y: U) = (x,y) // error
66
def f1[T](implicit x: T)[U] = (x,y) // error
7-
}
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object signatureCollision:
2+
def f[T](x: T)[U](y: U) = (x,y)
3+
def f[T](x: T, y: T) = (x,y) // error
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:8:11 ---------------------------------------------
2+
8 | f3[String]() // error
3+
| ^
4+
| Type argument String does not conform to upper bound Int
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:9:16 ---------------------------------------------
8+
9 | f5[Int][Unit] // error
9+
| ^
10+
| Type argument Unit does not conform to upper bound String
11+
|
12+
| longer explanation available when compiling with `-explain`
13+
-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:10:19 --------------------------------------------
14+
10 | f5[String][Unit] // error // error
15+
| ^
16+
| Type argument Unit does not conform to upper bound String
17+
|
18+
| longer explanation available when compiling with `-explain`
19+
-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:10:11 --------------------------------------------
20+
10 | f5[String][Unit] // error // error
21+
| ^
22+
| Type argument String does not conform to upper bound Int
23+
|
24+
| longer explanation available when compiling with `-explain`
25+
-- [E057] Type Mismatch Error: tests/neg/interleaving-typeApply.scala:11:11 --------------------------------------------
26+
11 | f7[String]()[Unit] // error
27+
| ^
28+
| Type argument String does not conform to upper bound Int
29+
|
30+
| longer explanation available when compiling with `-explain`

tests/neg/interleaving-typeApply.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ object typeApply:
99
f5[Int][Unit] // error
1010
f5[String][Unit] // error // error
1111
f7[String]()[Unit] // error
12-
}
12+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
object unmatched:
22
def f1[T (x: T)] = ??? // error
3-
def f2(x: Any[)T] = ??? // error // error
3+
def f2(x: Any[)T] = ??? // error // error

0 commit comments

Comments
 (0)