Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check compile errors #53

Open
fthomas opened this issue Jul 30, 2015 · 0 comments
Open

Check compile errors #53

fthomas opened this issue Jul 30, 2015 · 0 comments

Comments

@fthomas
Copy link
Collaborator

fthomas commented Jul 30, 2015

In refined are examples that show compile errors in certain situations:

  /**
   * Creates a `scala.util.matching.Regex` from a validated string.
   *
   * Example: {{{
   * scala> import eu.timepit.refined.implicits._
   *      | import eu.timepit.refined.util.string.regex
   *
   * scala> regex(".*")
   * res1: scala.util.matching.Regex = .*
   *
   * scala> regex("{")
   * <console>:41: error: Predicate isValidRegex("{") failed: Illegal repetition
   * {
   *        regex("{")
   *              ^
   * }}}
   */
  def ...

The first example is verified by sbt-doctest but the second is not. It would be awesome if sbt-doctest could also verify non-compiling examples.

shapeless has something like this called illTyped which also can check the error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant