Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Last active February 26, 2021 22:24
Show Gist options
  • Save deanwampler/f484edeb12620372855cb0baaf5502a3 to your computer and use it in GitHub Desktop.
Save deanwampler/f484edeb12620372855cb0baaf5502a3 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.string.* // Scala 2 uses _ as the wild card, which you can still use
val s1: "ab" + "cd" = "abcd"
val bad2: "ab" + "cd" = "abcdef" // ERROR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment