Skip to content

Blog Post: Announcing Dotty 0.6.0 and 0.7.0-RC1 #4053

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 23 commits into from
Mar 6, 2018
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ object Interpreter {
}
```

Earlier Dotty releases had issues typechecking such interpreters.
Earlier Scalac and Dotty releases had issues typechecking such interpreters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it sound like recent releases of scalac have fixed this, but they haven't. Also I would use the term "Scala 2" and not "Scalac".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most convincing thing to do would be to give an example that doesn't typecheck in Dotty but does in Scala 2.

Copy link
Contributor

@Blaisorblade Blaisorblade Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This program works in Scalac, while trickier ones trigger bugs in Scalac or Dotty. I propose to write "Scala 2 and Dotty have issues [...]", since we fixed some.

case class MapS[S, T](xs: Exp[List[S]], f: Exp[S => T]) extends Exp[List[T]]
case class Map[S, T, That](xs: Exp[List[S]], f: Exp[S => T])(implicit val cbf: CanBuildFrom[List[S], T, That]) extends Exp[That]

//...

    case m @ Map(xs, f)    =>
      //val f1: Exp[Any => Any] = f //accepted by Scalac, rejected by Dotty!
      eval(xs).map(eval(f))(m.cbf)

    case MapS(xs, f) =>
      eval(xs) map eval(f) //rejected by Dotty, not 100% sure why. Passing the 

   //alternatively:
    case m: MapS[s, t] =>
      //(eval(m.xs) map eval(m.f))(List.canBuildFrom) //fails in Dotty
      (eval(m.xs) map eval(m.f))(List.canBuildFrom[t]) //succeeds in Dotty

Failures in #4069 might be relevant.

EDIT: full example in #4076.

We have fixed multiple bugs about GADT type checking and exhaustiveness checking, especially for invariant GADTs, including
[#3666](https://github.com/lampepfl/dotty/issues/3666),
[#1754](https://github.com/lampepfl/dotty/issues/1754),
Expand Down