Skip to content

Commit 04ec4cb

Browse files
committed
Fix and mark errors in code snippets in dotty library
1 parent d228d36 commit 04ec4cb

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

library/src/scala/IArray.scala

+4-4
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

+1-1
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

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

+3-3
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/scala/compiletime/package.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import annotation.compileTimeOnly
88
/** Use this method when you have a type, do not have a value for it but want to
99
* pattern match on it. For example, given a type `Tup <: Tuple`, one can
1010
* pattern-match on it as follows:
11-
* ```scala
11+
* ```scala sc:nocompile
1212
* inline erasedValue[Tup] match {
1313
* case _: EmptyTuple => ...
1414
* case _: h *: t => ...
@@ -34,7 +34,7 @@ def uninitialized: Nothing = ???
3434
/** The error method is used to produce user-defined compile errors during inline expansion.
3535
* If an inline expansion results in a call error(msgStr) the compiler produces an error message containing the given msgStr.
3636
*
37-
* ```scala
37+
* ```scala sc:nocompile
3838
* error("My error message")
3939
* ```
4040
* or
@@ -72,7 +72,7 @@ transparent inline def codeOf(arg: Any): String =
7272
* inlining and constant folding.
7373
*
7474
* Usage:
75-
* ```scala
75+
* ```scala sc:nocompile
7676
* inline def twice(inline n: Int): Int =
7777
* requireConst(n) // compile-time assertion that the parameter `n` is a constant
7878
* n + n
@@ -116,7 +116,7 @@ end constValueTuple
116116

117117
/** Summons first given matching one of the listed cases. E.g. in
118118
*
119-
* ```scala
119+
* ```scala sc:nocompile
120120
* given B { ... }
121121
*
122122
* summonFrom {

0 commit comments

Comments
 (0)