This repository was archived by the owner on Dec 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Dotty support #61
Merged
Merged
Dotty support #61
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
smarter
reviewed
Apr 18, 2017
build.sbt
Outdated
// Dotty support | ||
.settings( | ||
libraryDependencies ++= { | ||
if (targetingDotty.value) Seq("ch.epfl.lamp" % "dotty_2.11" % scalaVersion.value % "scala-tool") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I removed it!
I updated the build according to @smarter review. Has anyone an idea of what does this error mean? |
Probably a bug in dotty |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: