# code-block-pro/1.27.4/build/shiki/samples/scala.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.27.4. 15 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.27.4/code/build/shiki/samples/scala.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.27.4/raw/build/shiki/samples/scala.sample
- Modified: 2023-09-03T01:04:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.27.4/code/build/shiki/samples/scala.sample#L10-L20`.

```
class Date(y: Int, m: Int, d: Int) extends Ord:
  // previous decls here

  def <(that: Any): Boolean = that match
    case d: Date =>
      (year < d.year) ||
      (year == d.year && (month < d.month ||
                         (month == d.month && day < d.day)))

    case _ => sys.error("cannot compare " + that + " and a Date")
  end <
end Date

// From https://docs.scala-lang.org/tutorials/scala-for-java-programmers.html

```
