Skip to content
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

Breaking changes between Scalac and Dotty -language:Scala2 #4027

Closed
allanrenucci opened this issue Feb 21, 2018 · 4 comments
Closed

Breaking changes between Scalac and Dotty -language:Scala2 #4027

allanrenucci opened this issue Feb 21, 2018 · 4 comments
Labels
compat:scala2 itype:meta Issues about process/similar

Comments

@allanrenucci
Copy link
Contributor

allanrenucci commented Feb 21, 2018

This is a meta issue aimed at listing all the breaking changes there are between Scalac and Dotty under Scala2 mode. This should make migration easier.

val o: { def foo: Int } = new Object { def foo = 1 } 
o.foo // Error in Dotty

import scala.reflect.Selectable.reflectiveSelectable
o.foo // OK
  • Scalac infers structural types
val o = new Object { def foo = 1 } 
o.foo // OK in Scalac

import scala.reflect.Selectable.reflectiveSelectable
o.foo // Error in Dotty
  • Overridden members without explicit type inherit type from parent in Dotty
class A { def opt: Option[Int] = None }
class B extends A { override def opt = Some(1) }
val some: Some[Int] = (new B).opt // Error in Dotty
@allanrenucci allanrenucci added compat:scala2 itype:meta Issues about process/similar labels Feb 21, 2018
@Blaisorblade
Copy link
Contributor

Lots of things under http://dotty.epfl.ch/docs/reference/dropped/ also should count — existential types, type projections in part (though there might still be changes), and so on. Though at least they're already listed. I'm uncomfortable with the amount of code which might be impacted, and with the fact that we don't have an estimate.

@Blaisorblade
Copy link
Contributor

New changes under discussion: #4490 (comment) (lest I forget to add it here later).

@Blaisorblade
Copy link
Contributor

#1473 was also meant to collect such issues. Probably both lists should be merged into a documentation page.

@OlivierBlanvillain
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat:scala2 itype:meta Issues about process/similar
Projects
None yet
Development

No branches or pull requests

3 participants