Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

julienrf
Copy link
Contributor

This PR includes work from @odersky and @biboudis as well as additional stuff to support cross compilation for both Scala 2.12 and Dotty.

I still have execution errors when running the tests:

Test strawman.collection.test.StrawmanTest.mainTest failed: java.lang.IncompatibleClassChangeError: Conflicting default methods: strawman/collection/SeqLike.coll strawman/collection/Iterable.coll

biboudis and others added 12 commits April 12, 2017 18:10
Note: `{ (a, b) => ... }` is not the same as `{ case (a, b) => ... }`.
When used in a fold, the second form will auto-box the two arguments and then
take them apart with a pattern match. I have seen that pattern in other
places in the strawman as well (e.g. RedBlackTree), we should eliminate
it there as well to not lose performance.
 - drop procedure syntax.
 - write inline annotation in `...`, because it's a keyword now.
No longer supported under dotty.
This is a case where the variance is indeed problematic, but scalac did
not detect it. Writing

    final class DupIterator(xs: Array[Iterable[T]]) ...

is morally equivalent to writing

    def dupIterator(xs: Array[Iterable[T]]) ...

In both cases `T` appears in non-variant position, so it can't be covariant in
class TrieIterator.

I guess the uncheckedVariace annotation is justified because DupIterator is only used
internally, but then we should declare it private.
dotty is not able to find the correct instantiation of `buildFromConstrainedPolyBuildable`,
and I have no idea how to teach it to do that.
Without the annotation we get:

    |found:    strawman.collection.mutable.ListBuffer.To[
    |  util.Right[Nothing, String] | util.Left[Int, Nothing]
    |](xs3)
    |required: strawman.collection.mutable.ListBuffer'[scala.util.Either[Int, String]]

Unfortunately, with union types, we get a different type inference in dotty. I don't know
how to fix this without giving up on union types.

I also wonder why we see the `To` type. It's not good that this one leaks out into an error message.
build.sbt Outdated
// Dotty support
.settings(
libraryDependencies ++= {
if (targetingDotty.value) Seq("ch.epfl.lamp" % "dotty_2.11" % scalaVersion.value % "scala-tool")
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be necessary with sbt 0.13.15

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks I removed it!

@julienrf
Copy link
Contributor Author

I updated the build according to @smarter review. Has anyone an idea of what does this error mean?

@smarter
Copy link
Member

smarter commented Apr 19, 2017

Probably a bug in dotty

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants