我在scala build.sbt
下面有文件。
scalaVersion := "2.12.8"
val ccompileOptions = Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-encoding", "UTF-8",
"-Ypartial-unification",
"-Xfatal-warnings",
"-Yliteral-types",
"-language:higherKinds"
)
scalacOptions ++= ccompileOptions
enablePlugins(TutPlugin)
tutTargetDirectory := baseDirectory.value
resolvers += Resolver.bintrayRepo("ovotech", "maven")
libraryDependencies ++= Seq(
"is.cir" %% "ciris-cats",
"is.cir" %% "ciris-cats-effect",
"is.cir" %% "ciris-core",
"is.cir" %% "ciris-enumeratum",
"is.cir" %% "ciris-refined"
).map(_ % "0.12.1")
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-dsl",
"org.http4s" %% "http4s-blaze-server"
).map(_ % "0.19.0")
libraryDependencies ++= Seq(
"com.ovoenergy" %% "ciris-kubernetes" % "0.5" ,
"org.typelevel" %% "kittens" % "1.2.0",
"eu.timepit" %% "refined-cats" % "0.9.3"
)
该项目可以在github here上找到。只需将scalaVersion更新为2.12.8
并注释掉此section。
如果我删除scalaVersion := "2.12.8"
并添加以下内容,则编译成功。
inThisBuild {
Seq(
scalaOrganization := "org.typelevel",
scalaVersion := "2.12.4-bin-typelevel-4"
)
}
当我用Google搜索时,似乎根据此issue从scala中删除了-Yliteral-types
选项。
但是我创建了一个项目,其中scala version 2.12.8的-Yliteral-types
标志启用了here,并且运行正常。
答案 0 :(得分:1)
是的,您将不得不使用Dotty或Typelevel编译器来访问发现的此功能。尽管SIP-23的文档并未明确说明这一点,但您上面提供的与文档结合的链接却可以。
答案 1 :(得分:1)