vinayawsm
vinayawsm

Reputation: 865

How to use dotty in scala project?

I am working on a Scala project that I run using sbt. I want to use union types which is provided by dotty. I am having trouble in using dotty in my project.

I did this:

Now if I compile the project, I get a huge list of Migration Warnings and errors like Member Not Found Error, Ambiguous overload, and ends with java.lang.AssertionError: no TypeBounds allowed. Is correcting each of these errors the only way to avoid these?

The project was running fine (with scalaVersion := 2.12.1) before making these changes. Can anyone please help me in making it work?

Edit: sbtVersion = 0.13.13

Upvotes: 3

Views: 843

Answers (1)

OlivierBlanvillain
OlivierBlanvillain

Reputation: 7768

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

  • Your setup to compile your project with sbt & dotty is probably correct (that answers the question?)
  • Your code base might trigger new bugs in dotty

StackOverflow is not the correct place to discuss bugs in unreleased software. If you manage to minimize your issue please report it on the dotty issue tacker (or come chat gitter). If you are interested in hacking on a compiler there are also plenty of opportunities in these early stages, external contributors are always very welcome!


Even if it's not part of your question I feel obliged to address @JörgWMittag comment. Dotty is not a new programming language. The long-term goal is to be able to cross compile the majority of the Scala ecosystem with both compiler, as it's currently the case with Scala 2.10/2.11/2.12. Dotty itself is an example of such project, every test is run with a version of compiler compiled by scalac (currently the default), and with a bootstrapped version of the compiler (dotty compiled with dotty).

In addition, a community-build infrastructure is currently being setup. It's a repository to gather (forks of) open source Scala projects that can be cross compile with scalac/dotty, which serves as an addition test infrastructure for the compiler.

Upvotes: 4

Related Questions