In Scala 2.13 singleton types are supported. They are useful e.g. in combination with Refined Types:
@newtype final case class Email(emailString: String Refined MatchesRegex[Email.Pattern])
object Email {
type Pattern = "(.+)@(.+)"
...
}
however even in 1.5 Scalastyle doesn't handle such input:
[error] /path/to/my/file.scala: Expected identifier, but got Token(STRING_LITERAL,"(.+)@(.+)",1054,"(.+)@(.+)")
Would it be possible to add such support?