Skip to content

Commit 816e4f5

Browse files
committed
docs: enable snippet compier on enums reference
This commit adds workaround for the MissingCoreLibraryException due to `sc:fail` and enables snippet compiler on enums reference documents. See #19513 (comment)
1 parent 792221d commit 816e4f5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/_docs/reference/enums/adts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ below:
100100
The following `View` enum has a contravariant type parameter `T` and a single case `Refl`, representing a function
101101
mapping a type `T` to itself:
102102

103-
```scala sc:fail
103+
```scala sc:nocompile
104104
enum View[-T]:
105105
case Refl(f: T => T)
106106
```
@@ -118,7 +118,7 @@ function type, leading to the following error:
118118

119119
Because `Refl` does not declare explicit parameters, it looks to the compiler like the following:
120120

121-
```scala sc:fail
121+
```scala sc:nocompile
122122
enum View[-T]:
123123
case Refl[/*synthetic*/-T1](f: T1 => T1) extends View[T1]
124124
```

docs/_docs/reference/enums/enums.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ enum class.
9999
Similarly, enum case declarations may not directly reference members of the enum's companion object,
100100
even if they are imported (directly, or by renaming). For example:
101101

102-
```scala sc:fail
102+
```scala sc:nocompile
103103
import Planet.*
104104
enum Planet(mass: Double, radius: Double):
105105
private final val (mercuryMass, mercuryRadius) = (3.303e+23, 2.4397e6)

project/Build.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,8 @@ object ScaladocConfigs {
23622362
s"$dottyLibRoot/src/scala=compile",
23632363
s"$dottyLibRoot/src/scala/compiletime=compile",
23642364
s"$dottyLibRoot/src/scala/util=compile",
2365-
s"$dottyLibRoot/src/scala/util/control=compile"
2365+
s"$dottyLibRoot/src/scala/util/control=compile",
2366+
"docs/_docs/reference/enums=compile"
23662367
)))
23672368
.add(SiteRoot("docs"))
23682369
.add(ApiSubdirectory(true))

0 commit comments

Comments
 (0)