Skip to content

Update to 3.0.0-M3 #48

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

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ project/boot/
project/plugins/project/
project/local-plugins.sbt
.history
.bsp

# Scala-IDE specific
.scala_dependencies
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
lazy val root = project
.in(file("."))
.settings(
name := "dotty-example-project",
description := "Example sbt project that compiles using Dotty",
name := "scala3-example-project",
description := "Example sbt project that compiles using Scala 3",
version := "0.1.0",

scalaVersion := "3.0.0-M2",
scalaVersion := "3.0.0-M3",

useScala3doc := true,
)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.6")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.0")
2 changes: 1 addition & 1 deletion src/main/scala/Conversion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Conversion {

def convert[T, U](x: T)(using converter: Conversion[T, U]): U = converter(x)

given IntWrapperToDoubleWrapper as Conversion[IntWrapper, DoubleWrapper] = new Conversion[IntWrapper, DoubleWrapper] {
given IntWrapperToDoubleWrapper: Conversion[IntWrapper, DoubleWrapper] = new Conversion[IntWrapper, DoubleWrapper] {
override def apply(i: IntWrapper): DoubleWrapper = new DoubleWrapper(i.a.toDouble)
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/ImpliedInstances.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ object ImpliedInstances {
override def parse(s: String): Try[A] = f(s)
}

given stringParser as StringParser[String] = baseParser(Success(_))
given intParser as StringParser[Int] = baseParser(s ⇒ Try(s.toInt))
given stringParser: StringParser[String] = baseParser(Success(_))
given intParser: StringParser[Int] = baseParser(s ⇒ Try(s.toInt))

given optionParser[A](using parser: => StringParser[A]) as StringParser[Option[A]] = new StringParser[Option[A]] {
given optionParser[A](using parser: => StringParser[A]): StringParser[Option[A]] = new StringParser[Option[A]] {
override def parse(s: String): Try[Option[A]] = s match {
case "" ⇒ Success(None) // implicit parser not used.
case str ⇒ parser.parse(str).map(x ⇒ Some(x)) // implicit parser is evaluated at here
Expand Down