-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Switch to the 2.13 standard library #7019
Commits on Aug 19, 2019
-
Remove accidental uses of the companion object Unit
The value of type Unit is `()`, using `Unit` usually also works because it refers to the companion object of the class Unit, and because of automatic `()` insertion when the expected type is `Unit`, but it's still wrong. 2.13 marked it as `@compileTimeOnly` which is how I noticed.
Configuration menu - View commit details
-
Copy full SHA for c485603 - Browse repository at this point
Copy the full SHA c485603View commit details -
Always fork when running stuff
This is easier to reason about, in particular because it avoids having to think about what kind of classloader sbt decided to inflict upon us. This fixes running the community-build test after switching to the 2.13 stdlib in the bootstrapped build.
Configuration menu - View commit details
-
Copy full SHA for f3ab8b9 - Browse repository at this point
Copy the full SHA f3ab8b9View commit details -
Treat some Java interfaces as universal traits
This matches the behavior of Scala 2, this is necessary when using the 2.13 stdlib where scala.Serializable is a type alias of java.lang.Serializable, otherwise the compiler will disallow extending both Serializable and AnyVal.
Configuration menu - View commit details
-
Copy full SHA for f041b1d - Browse repository at this point
Copy the full SHA f041b1dView commit details -
Start building Dotty against the 2.13 stdlib
This required some surgery in Build.scala: when compiling the non-bootstrapped compiler, we need the 2.12 stdlib on the JVM and compiler classpaths, because the current reference compiler cannot be run using the 2.13 stdlib, on the other hand when _running_ the non-bootstrapped compiler we need to the 2.13 stdlib on the compiler classpath to produce a bootstrapped compiler that links against 2.13. Upgrade the Scala 2 PickleFormat version to 5.2 (which is in fact identical to 5.0). Remove no longer needed -Ynew-collections flag and update the related test files.
Configuration menu - View commit details
-
Copy full SHA for 9953816 - Browse repository at this point
Copy the full SHA 9953816View commit details -
Replace getExternalDep and findLib by findArtifact, which is safer than getLib was (it doesn't use `contains` to find the name which might yield false positives).
Configuration menu - View commit details
-
Copy full SHA for a6efeb6 - Browse repository at this point
Copy the full SHA a6efeb6View commit details -
Change extension method naming scheme to match 2.13
See scala/scala#7896 and follow-up scala/scala#7922, we can do both steps at once since we always run with a bootstrapped dotty-library on the classpath, even if the compiler itself is not bootstrapped.
Configuration menu - View commit details
-
Copy full SHA for 662b7e0 - Browse repository at this point
Copy the full SHA 662b7e0View commit details -
Handle s and raw interpolator with 2.13 stdlib
These methods are now macros, so we always need to expand them.
Configuration menu - View commit details
-
Copy full SHA for 1168003 - Browse repository at this point
Copy the full SHA 1168003View commit details -
Cross-compile the compiler with the 2.13 stdlib
We still need to support compiling it against the 2.12 stdlib until we release a new reference compiler because the current reference compiler cannot use the 2.13 stdlib. This is mostly not a problem, except that this forces us to keep two versions of WeakHashSet, the same source file cannot be used for both the 2.12 and 2.13 stdlib since `-=` and `+=` are final in 2.13.
Configuration menu - View commit details
-
Copy full SHA for 5acd4bf - Browse repository at this point
Copy the full SHA 5acd4bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5053e03 - Browse repository at this point
Copy the full SHA 5053e03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ac18ba - Browse repository at this point
Copy the full SHA 1ac18baView commit details -
Compile the language server with the 2.13 stdlib
No cross-compilation needed since it's a bootstrapped-only project.
Configuration menu - View commit details
-
Copy full SHA for 2ae438d - Browse repository at this point
Copy the full SHA 2ae438dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 72a5b71 - Browse repository at this point
Copy the full SHA 72a5b71View commit details -
Update scala-xml for the 2.13 stdlib
Also update it to master.
Configuration menu - View commit details
-
Copy full SHA for 3f53d57 - Browse repository at this point
Copy the full SHA 3f53d57View commit details -
Allow implementing unapplySeq using scala.collection.Seq
Needed to compile scala-xml with the 2.13 stdlib.
Configuration menu - View commit details
-
Copy full SHA for af63f66 - Browse repository at this point
Copy the full SHA af63f66View commit details -
Adapt/remove tests for the 2.13 stdlib.
For the tests that were originally copied from scalac, I also copied the updated version if one existed, or removed it if they had removed it. Unfortunately, I also had to remove a bunch of Dotty tests that relied on details of the 2.12 stdlib that I couldn't easily port to the 2.13 stdlib. i3518 has to be disabled because using scala.Unit is marked @compileTimeOnly and dotty crashes on @compileTimeOnly right now.
Configuration menu - View commit details
-
Copy full SHA for b9ba16e - Browse repository at this point
Copy the full SHA b9ba16eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a767979 - Browse repository at this point
Copy the full SHA a767979View commit details -
Configuration menu - View commit details
-
Copy full SHA for 88b9c26 - Browse repository at this point
Copy the full SHA 88b9c26View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8873694 - Browse repository at this point
Copy the full SHA 8873694View commit details -
refactor, fix caseClassHash test
Static.mix(acc, this.productPrefix.hashCode()) in synthetic case class hash code updated to add parens.
Configuration menu - View commit details
-
Copy full SHA for 73f20b5 - Browse repository at this point
Copy the full SHA 73f20b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab20515 - Browse repository at this point
Copy the full SHA ab20515View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1ac8a9 - Browse repository at this point
Copy the full SHA c1ac8a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 832e0dd - Browse repository at this point
Copy the full SHA 832e0ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for a08d86b - Browse repository at this point
Copy the full SHA a08d86bView commit details -
Unmangle external references unpickled from Scala 2
This is necessary in particular to properly unpickle annotations with default arguments, since default arguments have mangled names, this is necessary to unpickle various parts of the 2.13 stdlib.
Configuration menu - View commit details
-
Copy full SHA for a946a3c - Browse repository at this point
Copy the full SHA a946a3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94485c7 - Browse repository at this point
Copy the full SHA 94485c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0eb4885 - Browse repository at this point
Copy the full SHA 0eb4885View commit details -
Configuration menu - View commit details
-
Copy full SHA for a60feb8 - Browse repository at this point
Copy the full SHA a60feb8View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd48d1c - Browse repository at this point
Copy the full SHA dd48d1cView commit details -
Say goodbye to the 2.12 stdlib
It's too hard to maintain it on top of the 2.13 stdlib, too bad because it's proven to be a great torture test of the compiler.
Configuration menu - View commit details
-
Copy full SHA for eaa10f1 - Browse repository at this point
Copy the full SHA eaa10f1View commit details -
Allow user-written productElementName
Needed to get the productElementName.scala test to pass when using the 2.13 stdlib
Configuration menu - View commit details
-
Copy full SHA for 983dc85 - Browse repository at this point
Copy the full SHA 983dc85View commit details -
Remove i966.scala test and corresponding code path
We can't compile this test with the 2.13 stdlib, and the only codepath it's supposed to exerce is currently dead code, I assume that the raw Array that showed up there was due to some bug that has since been fixed.
Configuration menu - View commit details
-
Copy full SHA for 792d610 - Browse repository at this point
Copy the full SHA 792d610View commit details -
Properly unpickle Scala 2 refinements
They're pickled with a class symbol, but we unpickled them as a type aliases, which meant that the logic in REFINEDtpe wasn't able to substitute `this` references correctly (there was even a comment expressing puzzlement about this). Instead, unpickle them as classes (TODO: add some logic in TreeChecker to make sure these symbols are never referenced anywhere).
Configuration menu - View commit details
-
Copy full SHA for 0cb2a53 - Browse repository at this point
Copy the full SHA 0cb2a53View commit details -
Fix classloader confusion in the REPL
The REPL constructed a classloader containing the user classpath but having the classloader used to run the REPL as a parent, meaning that the scala-library we actually used came from the JVM classpath, so of course everything exploded when using a repl compiled with the 2.12 stdlib and running with the 2.13 stdlib. Fixed by having Rendering#classpath be constructed without any parent, just based on the user classpath. This required some additional changes: - We called ScalaRuntime#replStringOf using the ScalaRunTime class from the scala-library used by the REPL, switch to calling it reflectively through - ReplDriver#withRedirectedOutput used `Console.withOut/Err` but that only affects the Console object in the current classloader, not the one in the user classloader, use `System.setOut/Err` instead (the class `System` comes from the system classloader so there's only one of it). - The macro tests now need to be run with the compiler on the user classpath, this required some refactoring (This would be simpler to handle if ReplTest didn't extend ReplDriver, but I'll let someone else do that refactoring)
Configuration menu - View commit details
-
Copy full SHA for 44b4754 - Browse repository at this point
Copy the full SHA 44b4754View commit details -
Configuration menu - View commit details
-
Copy full SHA for 658eecf - Browse repository at this point
Copy the full SHA 658eecfView commit details -
Fix typing of PartialFunction argument to overloaded method
Applications#preTypeArgs can type arguments with an expected type like `PartialFunction[Int, WildcardType]`, before this commit this was rejected by `typedClosure` because it requires the expected type to be fully-defined. Fixed by replacing the underdefined expected type by a new one where the argument types come from the closure method type. This is useful in particular to type `Map#collect` in 2.13 which is overloaded.
Configuration menu - View commit details
-
Copy full SHA for 3c2583f - Browse repository at this point
Copy the full SHA 3c2583fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cb144d - Browse repository at this point
Copy the full SHA 4cb144dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8778967 - Browse repository at this point
Copy the full SHA 8778967View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7c6df2 - Browse repository at this point
Copy the full SHA a7c6df2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a220ba1 - Browse repository at this point
Copy the full SHA a220ba1View commit details -
Avoid loop in subtype checking of applied types
`isMatchingApply(tp1)` compares the applied type `tp1` with `tp2`. Before this commit, we called it recursively incorrectly by passing it a type constructor instead of an applied type. The result was that it returned false when it shouldn't. This lead to infinite loops in some cases as demonstrated by tests/pos/factory-conversion.scala. Note: even before this commit, the added test case used to compile, but only when using a non-bootstrapped compiler. This puzzling behavior was due to the logic in `monitoredIsSubType` detecting the loop and breaking out of it before it lead to a stackoverflow. Of course this kind of detection is fragile since it depends on the stack size as well as the size of each stack frame, so we just happened to get lucky with the non-bootstrapped compiler but not with the bootstrapped one. As always, when debugging subtyping issues, it's a good idea to run the compiler with `-Yno-deep-subtypes` to replace the recovery logic in `monitoredIsSubType` by an immediate crash.
2Configuration menu - View commit details
-
Copy full SHA for 145132a - Browse repository at this point
Copy the full SHA 145132aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e2aff6 - Browse repository at this point
Copy the full SHA 0e2aff6View commit details -
Move macro test in the correct directory
Otherwise we'll run it with the non-bootstrapped compiler which can only work by chance.
Configuration menu - View commit details
-
Copy full SHA for 5f8b0bf - Browse repository at this point
Copy the full SHA 5f8b0bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cf8fd9 - Browse repository at this point
Copy the full SHA 0cf8fd9View commit details -
Fix exhaustiveness warnings on 2.13
SeqFactory changed package, since we never actually complete the symbol, this did not lead to a runtime error since we ended up creating a stub symbol for it.
Configuration menu - View commit details
-
Copy full SHA for 494cb00 - Browse repository at this point
Copy the full SHA 494cb00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38a423d - Browse repository at this point
Copy the full SHA 38a423dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 02c5293 - Browse repository at this point
Copy the full SHA 02c5293View commit details -
Configuration menu - View commit details
-
Copy full SHA for 71a022c - Browse repository at this point
Copy the full SHA 71a022cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b2f1eed - Browse repository at this point
Copy the full SHA b2f1eedView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea916ce - Browse repository at this point
Copy the full SHA ea916ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 67052f1 - Browse repository at this point
Copy the full SHA 67052f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d06960 - Browse repository at this point
Copy the full SHA 4d06960View commit details
Commits on Aug 21, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 1cd41fe - Browse repository at this point
Copy the full SHA 1cd41feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fa8e91 - Browse repository at this point
Copy the full SHA 1fa8e91View commit details
Commits on Aug 22, 2019
-
Take number of type parameters into account when choosing an overload
In Tasty, pickling a selection will pickle its signature using the SIGNED tag to be able to distinguish overloads, this usually works but it turns out that some overloads have the same signature (see tests/pos/poly-signature.scala, but this also affects `Set#++` in the 2.13 collections), resulting in ambiguous overload errors when unpickled. This commit solves this problem by also storing the number of type parameters in the signature. The obvious way to implement this would be to add a field of type Int to the `Signature` case class, but that wouldn't scale to a future where methods may have multiple type parameter lists, so instead we change the existing `paramsSig: List[TypeName]` field to take a list of `TypeName | Int`.
3Configuration menu - View commit details
-
Copy full SHA for f951534 - Browse repository at this point
Copy the full SHA f951534View commit details -
Configuration menu - View commit details
-
Copy full SHA for 335806a - Browse repository at this point
Copy the full SHA 335806aView commit details -
tests/pos/javaReadsSigs/fromjava.java still imported old collections doc-tool/test/dotty/tools/dottydoc/WhitelistedStdLib.scala and GenCollections depended on the removed scala 2 library
Configuration menu - View commit details
-
Copy full SHA for 953b940 - Browse repository at this point
Copy the full SHA 953b940View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9010a4b - Browse repository at this point
Copy the full SHA 9010a4bView commit details -
Make sure the community build runs with the correct ivy cache
This is necessary for the community build to work on the CI now that we run the community build with fork in Test set to true.
Configuration menu - View commit details
-
Copy full SHA for 00d2bf0 - Browse repository at this point
Copy the full SHA 00d2bf0View commit details -
And use this version as an indicator of 2.13 support, to allow sbt-dotty to work with nightly builds of 0.18 from both before and after the switch to 2.13.
Configuration menu - View commit details
-
Copy full SHA for f5459d0 - Browse repository at this point
Copy the full SHA f5459d0View commit details
Commits on Aug 23, 2019
-
Force a nightly to be published
To be used as a reference compiler in this PR so that we do not need to keep our codebase compatible with both the 2.12 and 2.13 stdlib which prevents us from fixing many deprecation warnings properly.
Configuration menu - View commit details
-
Copy full SHA for 8c856e9 - Browse repository at this point
Copy the full SHA 8c856e9View commit details -
Update reference compiler and remove final deprecations
- also updated drone.yml to remove nightly publishing
Configuration menu - View commit details
-
Copy full SHA for af66579 - Browse repository at this point
Copy the full SHA af66579View commit details -
Configuration menu - View commit details
-
Copy full SHA for a75c3f7 - Browse repository at this point
Copy the full SHA a75c3f7View commit details -
This is possible now that all deprecation warnings are fixed.
Configuration menu - View commit details
-
Copy full SHA for e27eb9d - Browse repository at this point
Copy the full SHA e27eb9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d13696 - Browse repository at this point
Copy the full SHA 3d13696View commit details -
ScriptEngine: Avoid classpath pollution
If we don't set "-classpath" explicily the default will be "-classpath .", this resulted in test failures due to "." containing the output of previous tests.
Configuration menu - View commit details
-
Copy full SHA for 878db33 - Browse repository at this point
Copy the full SHA 878db33View commit details -
Adapt tasty-reflect for the changes in Signature
Further work to present a nicer API for Signature might be needed.
Configuration menu - View commit details
-
Copy full SHA for e8db9d5 - Browse repository at this point
Copy the full SHA e8db9d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e32d39 - Browse repository at this point
Copy the full SHA 6e32d39View commit details -
Configuration menu - View commit details
-
Copy full SHA for f82d9a3 - Browse repository at this point
Copy the full SHA f82d9a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c5f9b2a - Browse repository at this point
Copy the full SHA c5f9b2aView commit details
Commits on Aug 24, 2019
-
Remove dead case and update checkfile
productElementName is no longer generated in Desugar after the previous commit.
Configuration menu - View commit details
-
Copy full SHA for 87416ea - Browse repository at this point
Copy the full SHA 87416eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fd550f - Browse repository at this point
Copy the full SHA 4fd550fView commit details -
It doesn't output an error anymore for some reason, but that's fine: we only care about it not crashing the compiler, which is what fuzzy tests check.
Configuration menu - View commit details
-
Copy full SHA for acfe55c - Browse repository at this point
Copy the full SHA acfe55cView commit details -
Inlining: Constant-fold select trees
This fixes a pickling/unpickling difference in sip23-valueof.scala and makes sense in general.
Configuration menu - View commit details
-
Copy full SHA for a553078 - Browse repository at this point
Copy the full SHA a553078View commit details -
Move original t5375 to pending
Needs to be replaced by something that doesn't use the parallel collections, I attempted to do so in b9ba16e but the result caused deadlocks, don't have time to investigate right now.
Configuration menu - View commit details
-
Copy full SHA for b4b9fe5 - Browse repository at this point
Copy the full SHA b4b9fe5View commit details -
I accidentally replaced `"` by `'` in the generated .dotty-ide.json file in 2ae438d which broke everything.
Configuration menu - View commit details
-
Copy full SHA for 79bcc5c - Browse repository at this point
Copy the full SHA 79bcc5cView commit details -
Fix -Ytest-pickler handling of aliases
We now need to dealias deeply to get tests/run/Course-2002-13.scala and tests/run/enrich-gentraversable.scala to pass.
Configuration menu - View commit details
-
Copy full SHA for 960498b - Browse repository at this point
Copy the full SHA 960498bView commit details -
Fix unstable compiler output due to using Set
`membersBasedOnFlags` internally uses `memberNames` which returns a Set, so the order of its elements is unstable. We were using it when generating static forwarder methods which lead to some idempotency tests failing (no idea why this didn't manifest itself before). Fixed by adding a new `sortedMembersBasedOnFlags` which sorts members by names and signatures (this required adding a somewhat arbitrary lexicographic ordering to Signature).
Configuration menu - View commit details
-
Copy full SHA for b93d83c - Browse repository at this point
Copy the full SHA b93d83cView commit details
Commits on Aug 25, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 13e76a7 - Browse repository at this point
Copy the full SHA 13e76a7View commit details -
Fix infinite-loop when using Jar#iterator
So far, Jar was defined as an Iterable implementation that overrides `foreach` and then define `override def iterator = this.toList.iterator` That was OK with the 2.12 stdlib, but stackoverflows with the 2.13 one due to `toList` now being implemented in terms of `iterator`. Any way, it turns out that we don't really need Jar to be an Iterable, so the simplest fix was to just remove these methods, and add back a `toList` for the one usesite that needed it (not very efficient, but not any worse than before).
Configuration menu - View commit details
-
Copy full SHA for 23f77c4 - Browse repository at this point
Copy the full SHA 23f77c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64bcaad - Browse repository at this point
Copy the full SHA 64bcaadView commit details -
Remove hiding of CanBuildFrom params from the IDE/REPL
Not needed with 2.13 where CanBuildFrom is mostly gone.
Configuration menu - View commit details
-
Copy full SHA for 3e4a9cc - Browse repository at this point
Copy the full SHA 3e4a9ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for a43efe3 - Browse repository at this point
Copy the full SHA a43efe3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e77e21 - Browse repository at this point
Copy the full SHA 9e77e21View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce05244 - Browse repository at this point
Copy the full SHA ce05244View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd56de3 - Browse repository at this point
Copy the full SHA cd56de3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a3ad0d - Browse repository at this point
Copy the full SHA 5a3ad0dView commit details -
Force another nightly to be published
To pick up the improvements since the previous one.
Configuration menu - View commit details
-
Copy full SHA for 6960f8d - Browse repository at this point
Copy the full SHA 6960f8dView commit details -
Bump reference compiler to the previous commit
And the revert the CI changes from the previous commit which are no longer needed.
Configuration menu - View commit details
-
Copy full SHA for 37fab22 - Browse repository at this point
Copy the full SHA 37fab22View commit details