Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Last active October 9, 2021 23:15
Show Gist options
  • Save deanwampler/157823ded061528af8eefe055af4861f to your computer and use it in GitHub Desktop.
Save deanwampler/157823ded061528af8eefe055af4861f to your computer and use it in GitHub Desktop.
// Adapted from
// https://github.com/deanwampler/programming-scala-book-code-examples/blob/master/src/script/scala/progscala3/typesystem/deptypes/DependentTypesSimple.scala
import scala.compiletime.ops.int.S // In 3.0.0, it's scala.compiletime.S !!
val s1: S[0] = 1
val s2a: S[S[0]] = 2
val s2b: S[1] = 2
val s3a: S[S[S[0]]] = 3
val s3b: S[2] = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment