Skip to content

Commit 304618f

Browse files
committed
Applied review comments
Updated test check files and Markdown syntax used in Scaladoc
1 parent ca2d87a commit 304618f

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

+2-5
Original file line numberDiff line numberDiff line change
@@ -3453,11 +3453,8 @@ object Types {
34533453
}
34543454

34553455
/** Returns the set of non-union (leaf) types composing this union tree with Nothing types
3456-
* absorbed by other types, if present.
3457-
* For example:
3458-
* {{{A | B | C | B | (A & (B | C)) | Nothing}}}
3459-
* returns
3460-
* {{{Set(A, B, C, (A & (B | C)))}}}
3456+
* absorbed by other types, if present. For example:<br>
3457+
* `(A | B | C | B | (A & (B | C)) | Nothing)` returns `Set(A, B, C, (A & (B | C)))`.
34613458
*/
34623459
private def gatherTreeUniqueMembersAbsorbingNothingTypes(using Context): Set[Type] = {
34633460
(tp1, tp2) match

tests/neg/i14823a.check

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
-- Error: tests/neg/i14823a.scala:16:51 --------------------------------------------------------------------------------
22
16 |val foo = summon[Mirror.Of[Box[Int] | Box[String]]] // error
33
| ^
4-
|No given instance of type deriving.Mirror.Of[Box[Int] | Box[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[Box[Int] | Box[String]]:
4+
|No given instance of type deriving.Mirror.Of[Box[Int] | Box[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[Box[Int] | Box[String]]:
55
| * type `Box[Int] | Box[String]` is not a generic product because its subpart `Box[Int] | Box[String]` is a top-level union type.
66
| * type `Box[Int] | Box[String]` is not a generic sum because its subpart `Box[Int] | Box[String]` is a top-level union type.
77
-- Error: tests/neg/i14823a.scala:17:61 --------------------------------------------------------------------------------
88
17 |val bar = summon[MirrorK1.Of[[X] =>> Box[Int] | Box[String]]] // error
99
| ^
10-
|No given instance of type MirrorK1.Of[[X] =>> Box[Int] | Box[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type MirrorK1.Of[[X] =>> Box[Int] | Box[String]]:
10+
|No given instance of type MirrorK1.Of[[X] =>> Box[Int] | Box[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type MirrorK1.Of[[X] =>> Box[Int] | Box[String]]:
1111
| * type `[A] =>> Box[Int] | Box[String]` is not a generic product because its subpart `Box[Int] | Box[String]` is a top-level union type.
1212
| * type `[A] =>> Box[Int] | Box[String]` is not a generic sum because its subpart `Box[Int] | Box[String]` is a top-level union type.
1313
-- Error: tests/neg/i14823a.scala:18:60 --------------------------------------------------------------------------------
1414
18 |def baz = summon[deriving.Mirror.Of[Foo[Int] | Foo[String]]] // error
1515
| ^
16-
|No given instance of type deriving.Mirror.Of[Foo[Int] | Foo[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[Foo[Int] | Foo[String]]:
16+
|No given instance of type deriving.Mirror.Of[Foo[Int] | Foo[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[Foo[Int] | Foo[String]]:
1717
| * type `Foo[Int] | Foo[String]` is not a generic product because its subpart `Foo[Int] | Foo[String]` is a top-level union type.
1818
| * type `Foo[Int] | Foo[String]` is not a generic sum because its subpart `Foo[Int] | Foo[String]` is a top-level union type.
1919
-- Error: tests/neg/i14823a.scala:20:66 --------------------------------------------------------------------------------
2020
20 |def qux = summon[deriving.Mirror.Of[Option[Int] | Option[String]]] // error
2121
| ^
22-
|No given instance of type deriving.Mirror.Of[Option[Int] | Option[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[Option[Int] | Option[String]]:
22+
|No given instance of type deriving.Mirror.Of[Option[Int] | Option[String]] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[Option[Int] | Option[String]]:
2323
| * type `Option[Int] | Option[String]` is not a generic product because its subpart `Option[Int] | Option[String]` is a top-level union type.
2424
| * type `Option[Int] | Option[String]` is not a generic sum because its subpart `Option[Int] | Option[String]` is a top-level union type.

tests/printing/i10693.check

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[[syntax trees at end of typer]] // tests/printing/i10693.scala
22
package <empty> {
33
final lazy module val i10693$package: i10693$package = new i10693$package()
4-
final module class i10693$package() extends Object() {
4+
final module class i10693$package() extends Object() {
55
this: i10693$package.type =>
66
def test[A >: Nothing <: Any, B >: Nothing <: Any](a: A, b: B): A | B = a
77
val v0: String | Int = test[String, Int]("string", 1)
88
val v1: Int | String = test[Int, String](1, "string")
9-
val v2: String | Int = test[(String | Int), (Int | String)](v0, v1)
10-
val v3: Int | String = test[(Int | String), (String | Int)](v1, v0)
11-
val v4: String | Int = test[(String | Int), (Int | String)](v2, v3)
12-
val v5: Int | String = test[(Int | String), (String | Int)](v3, v2)
13-
val v6: String | Int = test[(String | Int), (Int | String)](v4, v5)
9+
val v2: String | Int = test[String | Int, Int | String](v0, v1)
10+
val v3: Int | String = test[Int | String, String | Int](v1, v0)
11+
val v4: String | Int = test[String | Int, Int | String](v2, v3)
12+
val v5: Int | String = test[Int | String, String | Int](v3, v2)
13+
val v6: String | Int = test[String | Int, Int | String](v4, v5)
1414
val t0: List[Int] = Tuple1.apply[Int](1).toList
1515
val t1: List[Int] = Tuple2.apply[Int, Int](1, 2).toList
1616
val t2: List[Int] = Tuple3.apply[Int, Int, Int](1, 2, 3).toList
17-
val t3: List[Int | String] =
17+
val t3: List[Int | String] =
1818
Tuple3.apply[String, Int, Int]("A", 2, 3).toList
19-
val t4: List[String | Int] =
19+
val t4: List[String | Int] =
2020
Tuple3.apply[Int, String, String](1, "B", "C").toList
2121
}
2222
}

0 commit comments

Comments
 (0)