Skip to content

Commit 853317f

Browse files
committed
Fix and mark errors in code snippets in dotty library
1 parent 723a4da commit 853317f

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

library/src-bootstrapped/scala/compiletime/ops/int.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object int:
99
* case 0 => 1
1010
* case 1 => 2
1111
* case 2 => 3
12-
* ...
12+
* //...
1313
* case 2147483646 => 2147483647
1414
* }
1515
* ```
@@ -152,8 +152,8 @@ object int:
152152

153153
/** Negation of an `Int` singleton type.
154154
* ```scala
155-
* val neg1: Neg[-1] = 1
156-
* val neg2: Neg[1] = -1
155+
* val neg1: Negate[-1] = 1
156+
* val neg2: Negate[1] = -1
157157
* ```
158158
* @syntax markdown
159159
*/

library/src-bootstrapped/scala/compiletime/package.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import annotation.compileTimeOnly
66
/** Use this method when you have a type, do not have a value for it but want to
77
* pattern match on it. For example, given a type `Tup <: Tuple`, one can
88
* pattern-match on it as follows:
9-
* ```scala
9+
* ```scala sc:nocompile
1010
* inline erasedValue[Tup] match {
1111
* case _: EmptyTuple => ...
1212
* case _: h *: t => ...
@@ -32,7 +32,7 @@ def uninitialized: Nothing = ???
3232
/** The error method is used to produce user-defined compile errors during inline expansion.
3333
* If an inline expansion results in a call error(msgStr) the compiler produces an error message containing the given msgStr.
3434
*
35-
* ```scala
35+
* ```scala sc:nocompile
3636
* error("My error message")
3737
* ```
3838
* or
@@ -70,7 +70,7 @@ transparent inline def codeOf(arg: Any): String =
7070
* inlining and constant folding.
7171
*
7272
* Usage:
73-
* ```scala
73+
* ```scala sc:nocompile
7474
* inline def twice(inline n: Int): Int =
7575
* requireConst(n) // compile-time assertion that the parameter `n` is a constant
7676
* n + n
@@ -114,7 +114,7 @@ end constValueTuple
114114

115115
/** Summons first given matching one of the listed cases. E.g. in
116116
*
117-
* ```scala
117+
* ```scala sc:nocompile
118118
* given B { ... }
119119
*
120120
* summonFrom {

library/src/scala/IArray.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,11 @@ object IArray:
427427
/** Build an array from the iterable collection.
428428
*
429429
* {{{
430-
* scala> val a = IArray.from(Seq(1, 5))
431-
* val a: IArray[Int] = IArray(1, 5)
430+
* val a = IArray.from(Seq(1, 5))
431+
* //val a: IArray[Int] = IArray(1, 5)
432432
*
433-
* scala> val b = IArray.from(Range(1, 5))
434-
* val b: IArray[Int] = IArray(1, 2, 3, 4)
433+
* val b = IArray.from(Range(1, 5))
434+
* //val b: IArray[Int] = IArray(1, 2, 3, 4)
435435
* }}}
436436
*
437437
* @param it the iterable collection

library/src/scala/Tuple.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ object Tuple {
127127

128128
/** Filters out those members of the tuple for which the predicate `P` returns `false`.
129129
* A predicate `P[X]` is a type that can be either `true` or `false`. For example:
130-
* ```scala
130+
* ```scala sc:nocompile
131131
* type IsString[x] = x match {
132132
* case String => true
133133
* case _ => false

0 commit comments

Comments
 (0)