Skip to content

Commit e080d00

Browse files
authored
Merge pull request #10148 from romanowski/scala3doc/migration2
Migrate remaning commigs from scala3doc repo
2 parents a9c6a0b + a8d49f9 commit e080d00

File tree

63 files changed

+2976
-2868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2976
-2868
lines changed

scala3doc-testcases/src/example/Inheritance.scala

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import example.level2.Documentation
55
abstract class DocumentationInheritance[T, A <: Int, B >: String, -X, +Y] extends Documentation[T, A, B, X, Y] {}
66

77
class DocumentationInheritanceMethod:
8-
def wierdMethod[T, A <: Int, B >: String](t: T, a: A): B = ???
9-
def threOtherWay[A <: Nothing, B >: Any](a: A, c: B): Unit = ???
8+
def wierdMethod[T, A <: Int, B >: String](t: T, a: A): B = ???
9+
def threOtherWay[A <: Nothing, B >: Any](a: A, c: B): Unit = ???
1010

1111
class A:
12-
def this(s: String) = this()
13-
def this(i: Int) = this()
14-
type I = Int
15-
given Unit = ()
16-
extension (u: Unit) def foo = "foo"
17-
object X
18-
class B extends C:
19-
class D extends C
12+
def this(s: String) = this()
13+
def this(i: Int) = this()
14+
type I = Int
15+
given Unit = ()
16+
extension (u: Unit) def foo = "foo"
17+
object X
18+
class B extends C:
19+
class D extends C
2020

2121
class C extends A
+116-116
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,127 @@
11
package tests
22

33
trait FilterTestBaseTrait:
4-
/** doc */
5-
protected def protectetDefInheriteTrait(a: Int): String = ???
6-
/** doc */
7-
private def privateDefInheritedTrait(a: Int): String = ???
8-
/** doc */
9-
def publicDefInheritedTrait(a: Int): String = ???
10-
11-
/** doc */
12-
object PublicObjectInheritedTrait
13-
/** doc */
14-
protected object ProtectedObjectInheritedTrait
15-
16-
/** doc */
17-
protected val protectetValInheritedTrait = 123
18-
/** doc */
19-
private val privateValInheritedTrait = 344
20-
/** doc */
21-
val publicValInheritedTrait = 567
4+
/** doc */
5+
protected def protectetDefInheriteTrait(a: Int): String = ???
6+
/** doc */
7+
private def privateDefInheritedTrait(a: Int): String = ???
8+
/** doc */
9+
def publicDefInheritedTrait(a: Int): String = ???
10+
11+
/** doc */
12+
object PublicObjectInheritedTrait
13+
/** doc */
14+
protected object ProtectedObjectInheritedTrait
15+
16+
/** doc */
17+
protected val protectetValInheritedTrait = 123
18+
/** doc */
19+
private val privateValInheritedTrait = 344
20+
/** doc */
21+
val publicValInheritedTrait = 567
2222

2323
class FilterTestBase:
24-
/** doc */
25-
sealed abstract class BInherited
26-
/** doc */
27-
abstract case class CInherited(s: String)
28-
/** doc */
29-
sealed case class DInherited(c: String)
30-
/** doc */
31-
final case class EInherited(c: String)
32-
/** doc */
33-
private class PrivateInherited
34-
/** doc */
35-
protected class ProtectedInherited
36-
/** doc */
37-
protected def protectetDefInherited(a: Int): String = ???
38-
/** doc */
39-
private def privateDefInherited(a: Int): String = ???
40-
/** doc */
41-
def publicDefInherited(a: Int): String = ???
42-
43-
/** doc */
44-
object PublicObjectInherited
45-
/** doc */
46-
protected object ProtectedObjectInherited
47-
48-
/** doc */
49-
protected val protectetValInherited = 123
50-
/** doc */
51-
private val privateValInherited = 344
52-
/** doc */
53-
val publicValInherited = 567
54-
55-
/** doc */
56-
protected type protectedTypeInherited = 123
57-
/** doc */
58-
private type privateTypeInherited = 344
59-
/** doc */
60-
type publicTypeInherited = 567
61-
62-
/** doc */
63-
protected given Set[String | Int] = Set(1, "ala")
64-
/** doc */
65-
given Map[String, Double] = Map.empty
66-
67-
/** doc */
68-
protected given namedSet as Set[String | Int] = Set(1, "ala")
69-
/** doc */
70-
given namedMap as Map[String, Double] = Map.empty
24+
/** doc */
25+
sealed abstract class BInherited
26+
/** doc */
27+
abstract case class CInherited(s: String)
28+
/** doc */
29+
sealed case class DInherited(c: String)
30+
/** doc */
31+
final case class EInherited(c: String)
32+
/** doc */
33+
private class PrivateInherited
34+
/** doc */
35+
protected class ProtectedInherited
36+
/** doc */
37+
protected def protectetDefInherited(a: Int): String = ???
38+
/** doc */
39+
private def privateDefInherited(a: Int): String = ???
40+
/** doc */
41+
def publicDefInherited(a: Int): String = ???
42+
43+
/** doc */
44+
object PublicObjectInherited
45+
/** doc */
46+
protected object ProtectedObjectInherited
47+
48+
/** doc */
49+
protected val protectetValInherited = 123
50+
/** doc */
51+
private val privateValInherited = 344
52+
/** doc */
53+
val publicValInherited = 567
54+
55+
/** doc */
56+
protected type protectedTypeInherited = 123
57+
/** doc */
58+
private type privateTypeInherited = 344
59+
/** doc */
60+
type publicTypeInherited = 567
61+
62+
/** doc */
63+
protected given Set[String | Int] = Set(1, "ala")
64+
/** doc */
65+
given Map[String, Double] = Map.empty
66+
67+
/** doc */
68+
protected given namedSet as Set[String | Int] = Set(1, "ala")
69+
/** doc */
70+
given namedMap as Map[String, Double] = Map.empty
7171

7272
class FilterTest extends FilterTestBase with FilterTestBaseTrait:
73-
/** doc */
74-
sealed abstract class B
75-
/** doc */
76-
abstract case class C(s: String)
77-
/** doc */
78-
sealed case class D(c: String)
79-
/** doc */
80-
final case class E(c: String)
81-
/** doc */
82-
private class Private
83-
/** doc */
84-
protected class Protected
85-
86-
/** doc */
87-
object PublicObject
88-
/** doc */
89-
protected object ProtectedObject
90-
91-
/** doc */
92-
protected def protectetDef(a: B): String = ???
93-
/** doc */
94-
private def privateDef(a: C): String = ???
95-
/** doc */
96-
def publicDef(a: D): FilterTest = ???
97-
98-
99-
/** doc */
100-
protected val protectetVal = 123
101-
/** doc */
102-
private val privateVal= 344
103-
/** doc */
104-
val publicVal = 567
105-
106-
/** doc */
107-
protected type protectedType = 123
108-
/** doc */
109-
private type privateType= 344
110-
/** doc */
111-
type publicType = 567
112-
113-
/** doc */
114-
protected given Seq[String | Int | Double] = List(1)
115-
/** doc */
116-
given List[String] = "ula" :: Nil
117-
118-
/** doc */
119-
given namedList as List[String] = "ula" :: Nil
120-
/** doc */
121-
protected given namedSeq as Seq[String | Int | Double] = List(1)
73+
/** doc */
74+
sealed abstract class B
75+
/** doc */
76+
abstract case class C(s: String)
77+
/** doc */
78+
sealed case class D(c: String)
79+
/** doc */
80+
final case class E(c: String)
81+
/** doc */
82+
private class Private
83+
/** doc */
84+
protected class Protected
85+
86+
/** doc */
87+
object PublicObject
88+
/** doc */
89+
protected object ProtectedObject
90+
91+
/** doc */
92+
protected def protectetDef(a: B): String = ???
93+
/** doc */
94+
private def privateDef(a: C): String = ???
95+
/** doc */
96+
def publicDef(a: D): FilterTest = ???
97+
98+
99+
/** doc */
100+
protected val protectetVal = 123
101+
/** doc */
102+
private val privateVal= 344
103+
/** doc */
104+
val publicVal = 567
105+
106+
/** doc */
107+
protected type protectedType = 123
108+
/** doc */
109+
private type privateType= 344
110+
/** doc */
111+
type publicType = 567
112+
113+
/** doc */
114+
protected given Seq[String | Int | Double] = List(1)
115+
/** doc */
116+
given List[String] = "ula" :: Nil
117+
118+
/** doc */
119+
given namedList as List[String] = "ula" :: Nil
120+
/** doc */
121+
protected given namedSeq as Seq[String | Int | Double] = List(1)
122122

123123
extension (e: FilterTest):
124-
def extensionMethod(name: FilterTest): FilterTest = ???
124+
def extensionMethod(name: FilterTest): FilterTest = ???
125125

126126
extension (e: FilterTestBase):
127-
def extensionMethodBase(name: FilterTest): FilterTest = ???
127+
def extensionMethodBase(name: FilterTest): FilterTest = ???

scala3doc-testcases/src/tests/annotations.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ class AnnotatedParams(@MyAnnotation val a: String, @AnnotationWithMultiArg(2, "c
2323

2424
class AnnotatedMethods
2525
{
26-
@MyAnnotation @AnnotationWithMultiArg(2, "cda", 'a', 'b', 'c') def a: String
27-
= ???
26+
@MyAnnotation @AnnotationWithMultiArg(2, "cda", 'a', 'b', 'c') def a: String
27+
= ???
2828
}

scala3doc-testcases/src/tests/annotationsExample.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ package annotationsExample
44
import scala.annotation.StaticAnnotation
55

66
enum Enum {
7-
case A extends Enum
8-
case B extends Enum
9-
case C extends Enum
7+
case A extends Enum
8+
case B extends Enum
9+
case C extends Enum
1010
}
1111

1212
class SomeObject(val s: String)
@@ -28,8 +28,8 @@ class AnnotatedParams(@MyAnnotation val a: String, @AnnotationWithMultiArg(2, "c
2828

2929
class AnnotatedMethods
3030
{
31-
@MyAnnotation
32-
@AnnotationWithMultiArg(2, "cda", 'a', 'b', 'c')
33-
def a: String
34-
= ???
31+
@MyAnnotation
32+
@AnnotationWithMultiArg(2, "cda", 'a', 'b', 'c')
33+
def a: String
34+
= ???
3535
}

scala3doc-testcases/src/tests/classSignatureTestSource.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import example.level2.Documentation
88

99
abstract class Documentation[T, A <: Int, B >: String, -X, +Y](c1: String, val c2: List[T]) extends Seq[T] with Product with Serializable
1010
{
11-
def this(ac: String)
11+
def this(ac: String)
1212
= this(ac, Nil)
1313

14-
def this()
14+
def this()
1515
= this("", Nil)
1616

17-
def this(x: T)
17+
def this(x: T)
1818
= this()
1919

2020
class innerDocumentationClass

scala3doc-testcases/src/tests/companionObjectSignatures.scala

+17-17
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ package companionObjectSignatures
33

44
case class CaseClass(parameterOfClassConstructor: String)
55
{
6-
val classProperty1: String
7-
= ???
8-
val classProperty2: String
9-
= ???
10-
def methodInClass1(): String
11-
= ???
12-
13-
def methodInClass2(): CaseClass
14-
= ???
6+
val classProperty1: String
7+
= ???
8+
val classProperty2: String
9+
= ???
10+
def methodInClass1(): String
11+
= ???
12+
13+
def methodInClass2(): CaseClass
14+
= ???
1515
}
1616

1717
case object CaseClass
1818
{
19-
val parameterOfObject: String
20-
= "asd"
21-
22-
def methodInCompanion1(): String
23-
= ???
24-
25-
def methodInCompanion2(): CaseClass
26-
= ???
19+
val parameterOfObject: String
20+
= "asd"
21+
22+
def methodInCompanion1(): String
23+
= ???
24+
25+
def methodInCompanion2(): CaseClass
26+
= ???
2727
}
2828

2929
case class WithoutExplicitCompanion(parameter: Int)

0 commit comments

Comments
 (0)