-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
I recently ported a project from Scala 2 to Scala 3 with some modules using Scala 2 and others using Scala 3. I ran into several gotchas that might be worth talking about in the docs somewhere. The entire migration process used sbt and sbt-migrate.
- My Scala 2 project was using 2.13.6 while the latest sbt-migrate attempts to migrate projects to
3.1.*. Once the migration commands are completed, compilation failed because 2.13.6 TastY reader cannot read class files compiled with3.1(as far as I can tell). The error message was confusion since it just gave me the major/minor versions that TastY was expecting without explaining what I can do to fix it or what could be a potential cause. - After migration, I attempted to convert some
sealed traitdefinitions intoenumbut the compiler kept rejecting the syntax.
2a. While attempting to fix this problem, I separately discovered the-new-syntax,-indent, and-rewriteflags. The migration docs should probably link to that page as a good next step once a module is migrated to Scala 3.
2b. Eventually, someone on the gitter channel pointed out thesbt-migratesets the-source:3.0-migrationoption which causes the compiler to reject the new constructs. Disabling the plugin made my code work.
Metadata
Metadata
Assignees
Labels
No labels