aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix constraint handling in eitherIsSubtypeMartin Odersky2016-04-211-1/+1
| | | | | | | | The logic in typeComparer#eitherIsSubtype was flawed. In the case of A & B <: C, if A <: C but not B <: C we need to return with the constraint of A <: C, but we returned with the initial constraint instead.
* Always minimize type variables when interpolating an expected type of an ↵Martin Odersky2016-04-212-7/+8
| | | | | | implicit. This was suggested in #878.
* Merge pull request #1219 from dotty-staging/fix-strawmansDmitry Petrashko2016-04-2011-46/+654
|\ | | | | Fix strawmans
| * Updates of strawmanMartin Odersky2016-04-172-67/+130
| | | | | | | | | | Bring strawman-4 and strawman-5 to feature-parity. Test also strawman-4.
| * Strawman polishingMartin Odersky2016-04-161-9/+3
| |
| * Add companions to value classes during desugaringsMartin Odersky2016-04-153-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means companions will be pickled and we can drop the special treatement in transformInfo of FirstTransform. That method is problematic, since it enters new symbols into a class scope. This is not allowed, since transformInfo needs to be purely functional, side effects are not permitted (`enteredAfter` does not work either). The problem manifested itself when compiling colltest5 with a requirement failure in the code of `entered` when called from FirstTransform (trying to enter in a frozen class). TODO: Once we use statics for LazyVals we can get rid of the "add companion object" logic in FirstTransform alltogether.
| * Make Names immutable SeqsMartin Odersky2016-04-151-1/+1
| |
| * Tweak in NameOpsMartin Odersky2016-04-151-1/+1
| | | | | | | | | | The previous version seemed to fail non-deterministaically, but after a while I could not reproduce it anymore. Anyway, leaving the change in.
| * Dealias applied type constructorsMartin Odersky2016-04-151-2/+10
| | | | | | | | | | | | Dealias TypeRefs that get applied to type arguments. Without that precaution we get Stackoverflows in lookupRefined/betaReduce for CollectionStrawMan5.scala.
| * Fix toString and productPrefix of case objectsMartin Odersky2016-04-151-2/+6
| | | | | | | | Need to drop the final `$' in both cases.
| * Fix #765 for super accessorsMartin Odersky2016-04-151-1/+10
| | | | | | | | | | Partial fix of #765. Hack to make sure unexpandedName works for super accessor names.
| * Create LambdaTraits referred to from UnpicklerMartin Odersky2016-04-152-1/+8
| | | | | | | | | | LambdaTraits are created on demand; we need to make sure they exist when referred to from Tasty.
| * Small improvements in TypesMartin Odersky2016-04-151-2/+4
| | | | | | | | | | 1) Print RefinedTypes with their hashCode so that we can correlated with RefinedThis types 2) Fast abort of instantiate in case we have determined that it is not safe anyway
| * New testsMartin Odersky2016-04-152-1/+510
| | | | | | | | | | | | | | New CollectionStrawMan5, executed as runttest in two different ways: - built with scalac, test compiled by dotty in tests/run. - built with dotty, test compiled by dotty using separate compilation.
* | Address review comments of #1188Dmitry Petrashko2016-04-183-9/+10
| |
* | Address review comments.Dmitry Petrashko2016-04-181-5/+5
| | | | | | | | https://github.com/lampepfl/dotty/pull/1188
* | ArrayConstructors: don't optimise creating of multi-dim generic arrays.Dmitry Petrashko2016-04-181-8/+7
| | | | | | | | They need to be created through their class tag.
* | Separate handling of genericArray creation from normal ones.Dmitry Petrashko2016-04-183-18/+18
| | | | | | | | | | | | This allowed to simplify the code in both Applications and tpd.newArray. Now, only creation of generic arrays is handled by typer. All other arrays are handled in ArrayConstructors phase.
* | Bring back convertNewArray into typer.Dmitry Petrashko2016-04-182-2/+15
| | | | | | | | | | It's needed in order to create calls to newGenricArray as it needs to infer the ClassTag.
* | make tpd.JavaSeqLiteral return JavaSeqLiteralDmitry Petrashko2016-04-182-3/+4
| |
* | Erasure: Erase constant literals.Dmitry Petrashko2016-04-181-2/+3
| | | | | | | | | | | | The problem comes from JavaArrayTypes. They are invalid before erasure, and cannot be pickled, while Array[T] is invalid after erasure and should be erased.
* | Update to new version of DottyBackendInterface.Dmitry Petrashko2016-04-181-8/+1
| | | | | | | | That knows that there exists only single magical array method.
* | Decouple handling array constructors from typer.Dmitry Petrashko2016-04-185-14/+67
| | | | | | | | It's done in a separate ArrayConstructors phase now.
* | Get rid of all new***Array methods expect one.Dmitry Petrashko2016-04-183-53/+22
| | | | | | | | | | This one is able to encode creation of array of any type and any dimension. Note, it does not handle value classes.
* | Fix #1167: Remove the magic from Arrays.newRefArray.Sébastien Doeraene2016-04-188-67/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the method `Arrays.newRefArray` was one of the only 3 methods that are kept generic after erasure. This commit removes this magic, by making it take an actual `j.l.Class[T]` as parameter. Moreover, the methods `newXArray` all receive an actual body, implemented on top of Java reflection, which means that a back-end does not *have to* special-case those methods for correctness. It might still be required for performance, though, depending on the back-end. The JVM back-end is made non-optimal in this commit, precisely because it does not specialize that method anymore. Doing so requires modifying the fork of scalac that we use, which should be done separately. The JS back-end is adapted simply by doing nothing at all on any of the newXArray methods. It will normally call the user-space implementations which use reflection. The Scala.js optimizer will inline and intrinsify the reflective calls, producing optimal code, at the end of the day.
* | Implement loading static fields in the Scala.js back-end.Sébastien Doeraene2016-04-181-3/+21
| |
* | Merge pull request #1205 from dotty-staging/method-checkDmitry Petrashko2016-04-181-1/+10
|\ \ | | | | | | Ycheck that all methods have method type
| * | Ycheck that all methods have method typeliu fengyun2016-04-151-1/+10
| |/
* | Merge pull request #1200 from dotty-staging/docs-denotationsodersky2016-04-161-12/+29
|\ \ | | | | | | Docs and polishing for denotation insertions
| * | Fix commentMartin Odersky2016-04-031-4/+5
| | |
| * | Fix copy-paste errorMartin Odersky2016-04-031-2/+2
| | |
| * | Docs and polishing for denotation insertionsMartin Odersky2016-04-031-10/+26
| | | | | | | | | | | | | | | | | | Better organization and documentation for the way a symbol's denotations are kept in a ring. This came out of a failed attempt to optimize by adding a `prevInRun` field.
* | | Merge pull request #1211 from dotty-staging/fix-#1202odersky2016-04-1615-65/+122
|\ \ \ | |_|/ |/| | Fix Tasty errors
| * | Avoid creating a SourceFile annotation for SourceFile itselfMartin Odersky2016-04-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This leads to an infinite cycle when trying to unpickling, because the modifiers and annotations of a symbol are read before the symbol itself is created. See #1212 for the general case.
| * | Simplify handling of sourcefiles in Tasty infoMartin Odersky2016-04-095-33/+17
| | | | | | | | | | | | | | | | | | | | | Instead of separate source file sections, pickle SourceFile as an annotation of all toplevel classes. We represent it like this anyway when reading back Tasty-defined classes.
| * | Store source files as normal paths, not canonical ones.Martin Odersky2016-04-082-2/+16
| | | | | | | | | | | | This is the same as what Java does for its ClassFile attribute.
| * | Explain isTyper field in Phase.Martin Odersky2016-04-081-1/+5
| | |
| * | Add source file for SourceFile annotationMartin Odersky2016-04-081-0/+10
| | |
| * | Fix unpickling of Java SeqLiteralsMartin Odersky2016-04-071-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two problems were fixed: - isJava needs to look at function symbol, not its type (references to Java methods get normal MethodTypes not JavMethodTypes) - we also need to handle the case where the repeated argument is wrspped in a type ascription.
| * | Update TastyFormat for SeqLiteralMartin Odersky2016-04-071-1/+1
| | | | | | | | | | | | SeqLiteral have an elemTpt, which was missing in format.
| * | Fix flags when unpickling setters of parameter accessorsMartin Odersky2016-04-071-0/+5
| | | | | | | | | | | | | | | | | | ParamAccessor is not a pickled flag. This is not a problem for normal parameter accessors which are pickled as PARAM fields. But setters of parameter accessors also need to have the flag set (and Deferred reset).
| * | Take SourceFile annotations into account when computing sourceFileMartin Odersky2016-04-072-13/+17
| | | | | | | | | | | | | | | | | | | | | If a file was loaded from TASTY, it can not still have a non-null source file, since the source file is unpickled into the annotation of a top-level class. Also, fix typo in previous commit.
| * | Add unpickled source file path as annotation to root symbolsMartin Odersky2016-04-071-4/+8
| | |
| * | Pickle sourcefile attribute with canonical pathMartin Odersky2016-04-071-1/+1
| | |
| * | Fix reading of SourceFile attribute from TastyMartin Odersky2016-04-071-2/+4
| | | | | | | | | | | | The previous path name always had a "Simple(...)" wrapped around it.
| * | Add dotty.annotation.internal.SourceFile annotationMartin Odersky2016-04-072-0/+5
| | |
| * | Make first phase of FromTasty not be a TyperMartin Odersky2016-04-071-0/+3
| | | | | | | | | | | | | | | `isTyper` is used to enable some error checking and handling, which need not be done when in FromTasty.
| * | Treat type parameters of secondary constructors as aliasesMartin Odersky2016-04-072-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... of class parameters using the gadt mechanism. Previously they were encoded as aliases by hardcoding alias bounds in the type parameter declaration, but that then leads to weird behavior and failures in unpickling. To make this work, we also need to propagate gadt bounds into the this-call context. Test case in pickling/i1202a.scala.
| * | Take type parameters for this(...) constructor calls from prefixMartin Odersky2016-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, those were inferred from arguments, but this is wrong because we implicitly assume that the type parameters of the constructor and the type parameters of the class are the same. I could not find a test that fails for this. But if you look at the -Xprint:front output of pos/i941.scala, you notice that the inferred argument to the this(...) call was `Nothing` where it should have been `A`.
| * | Search implicit arguments in the same context as typing explicit onesMartin Odersky2016-04-072-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | For explicit arguments of this(...) constrictor calls we have a special context that hides members of the current class. But for implicit arguments we did not. This led to implicit shadowing errors for scala.collection.immutable.PagedSeq when secondary constructor type parameters were fixed (as done in subsequent commits).