How do I use dotty in a scala project?

I am working on a Scala project that I am starting with sbt

. I want to use the union types that are provided dotty

. I am having trouble using it dotty

in my project.

I did this:

  • Added ./projects/plugins.sbt

    and ./projects/build.properties

    with content specified in sbt-dotty .
  • Added ./projects/scalafix.sbt

    and a configuration file ./.scalafix.conf

    with content scalafixEnabled in ThisBuild := true

    in it. This is represented in sbt-scalafix

Now if I compile the project, I get a huge list of Migration Warning

both errors like Member Not Found Error

, Ambiguous overload

and ends with java.lang.AssertionError: no TypeBounds allowed

. Does each of these errors fix the only way to avoid it?

The project was working fine before making these changes (with scalaVersion: = 2.12.1). Can anyone help me with my work?

Edit: sbtVersion = 0.13.13

+3


source to share


1 answer


Dotty is currently in experimental stage (pre-alpha, no public release at the time of writing). The fact that you are getting compilation errors means the following:

  • Your setup to compile your project with sbt and dotty is probably correct (what answers the question?)
  • Your codebase may throw new errors at points

StackOverflow is not suitable for discussing bugs in unreleased software. If you manage to minimize the problem, report it to the point questionnaire (or go to the gitter chat ). If you are interested in compiler hacking, there are many possibilities in these early stages as well, external contributors are always welcome!




Even if this is not part of your question, I feel obligated to answer @ JörgWMittag's comment. Dotty is not a new programming language. The long term goal is to be able to cross-compile most of the Scala ecosystem with both compilers, as is currently the case with Scala 2.10 / 2.11 / 2.12. Dotty itself is an example of such a project, each test is run with a compiler version compiled scalac

(currently by default) and a bootable compiler version ( dotty

compiled with dotty

).

In addition, the community-build infrastructure is currently being configured . It is a repository for collecting (forks) Scala open source projects that can be cross-compiled with scalac

/ dotty

, which serves as an additional test framework for the compiler.

+4


source







All Articles