Skip to content

Commit

Permalink
Merge pull request #15206 from rochala/documentation-snippet-typo
Browse files Browse the repository at this point in the history
scaladoc: fix documentation snippet typos
  • Loading branch information
bishabosha authored May 19, 2022
2 parents 1390609 + 9e33699 commit ee9cc8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/_docs/contributing/debug-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can run `help` for commands that supported by JDB.

Following file (`tests/debug/while.scala`) is an example of annotated source code:

```Scala
```scala
object Test {

def main(args: Array[String]): Unit = {
Expand Down
16 changes: 8 additions & 8 deletions docs/_docs/reference/changed-features/pattern-matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Scala 3 supports a superset of Scala 2 [extractors](https://www.scala-lang.org/f

Extractors are objects that expose a method `unapply` or `unapplySeq`:

```Scala
```scala
def unapply[A](x: T)(implicit x: B): U
def unapplySeq[A](x: T)(implicit x: B): U
```
Expand All @@ -25,7 +25,7 @@ called variadic extractors, which enables variadic patterns.

Fixed-arity extractors expose the following signature:

```Scala
```scala
def unapply[A](x: T)(implicit x: B): U
```

Expand All @@ -36,7 +36,7 @@ The type `U` conforms to one of the following matches:

Or `U` conforms to the type `R`:

```Scala
```scala
type R = {
def isEmpty: Boolean
def get: S
Expand All @@ -62,7 +62,7 @@ A usage of a fixed-arity extractor is irrefutable if one of the following condit

Variadic extractors expose the following signature:

```Scala
```scala
def unapplySeq[A](x: T)(implicit x: B): U
```

Expand All @@ -73,7 +73,7 @@ The type `U` conforms to one of the following matches:

Or `U` conforms to the type `R`:

```Scala
```scala
type R = {
def isEmpty: Boolean
def get: S
Expand Down Expand Up @@ -167,7 +167,7 @@ object Nat:
- `N > 1` is the maximum number of consecutive (parameterless `def` or `val`) `_1: P1 ... _N: PN` members in `U`
- Pattern-matching on exactly `N` patterns with types `P1, P2, ..., PN`

```Scala
```scala
object ProdEmpty:
def _1: Int = ???
def _2: String = ???
Expand All @@ -184,7 +184,7 @@ object ProdEmpty:

- `U <: X`, `T2` and `T3` conform to `T1`

```Scala
```scala
type X = {
def lengthCompare(len: Int): Int // or, `def length: Int`
def apply(i: Int): T1
Expand Down Expand Up @@ -219,7 +219,7 @@ object CharList:
- Pattern-matching on exactly `>= N` patterns, the first `N - 1` patterns have types `P1, P2, ... P(N-1)`,
the type of the remaining patterns are determined as in Seq Pattern.

```Scala
```scala
class Foo(val name: String, val children: Int*)
object Foo:
def unapplySeq(f: Foo): Option[(String, Seq[Int])] =
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/reference/experimental/explicit-nulls.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ The program in [`unsafeNulls`](https://scala-lang.org/api/3.x/scala/runtime/stdL
For example, the following code cannot be compiled even using unsafe nulls. Because of the
Java interoperation, the type of the get method becomes `T | Null`.

```Scala
```scala
def head[T](xs: java.util.List[T]): T = xs.get(0) // error
```

Expand Down

0 comments on commit ee9cc8f

Please sign in to comment.