aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Honor -Yno-imports flagMartin Odersky2015-05-042-2/+4
| | | | If the flag is set, no root imports are added.
* Merge pull request #517 from dotty-staging/add/expand-privatesodersky2015-05-0412-43/+79
|\ | | | | Expand private members if necessary
| * Refchecks runs before resolveSuper: superAccessors not yet materialised.Dmitry Petrashko2015-05-031-0/+1
| |
| * TreeChecker: check for absence of private abstract methods.Dmitry Petrashko2015-05-032-11/+5
| |
| * SuperAccessors: Do not create abstract private members.Dmitry Petrashko2015-05-031-2/+2
| |
| * ExpandPrivate: Make sure Deferred members are not Private.Dmitry Petrashko2015-05-031-4/+13
| |
| * Fixed doc comment.Martin Odersky2015-05-021-6/+2
| |
| * Expand name should use initial owner.Martin Odersky2015-05-011-1/+6
| |
| * Get rid of NotPrivate flag.Martin Odersky2015-05-014-7/+3
| | | | | | | | It is now redundant.
| * New miniphase: ExpandPrivateMartin Odersky2015-05-014-30/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | A late miniphase which resets private flag of all members that are not accessed from within same class. Replaces logic in RefChecks. Doing this late has two advantages - we can use name expansion, because references are symbolic, so the names of symbols and references to them do not need to correspond anymore. - we can automatically correct for symbols moved in earlier phases (e.g. lifted out by LambdaLift).
| * Make sure mixin accessors are not private.Martin Odersky2015-05-012-4/+2
| | | | | | | | | | | | Logic moved from RefChecks to Mixin; implementation is now by name expansion instead of setting NotJavaPrivate flag.
| * New method for SymDenotations: ensureNotPrivateMartin Odersky2015-05-011-0/+7
| | | | | | | | Resets private flag, and expands the name if necessary.
| * Drop reference to NotJavaPrivate in access checks.Martin Odersky2015-05-011-1/+1
| | | | | | | | | | Verified that all tests still run. This is a first step, so that we can later on eliminate NotJavaPrivate altogether.
* | Merge pull request #520 from dotty-staging/refactor/picklingodersky2015-05-0327-47/+47
|\ \ | | | | | | Pickling modularization reorg
| * | Pickling modularization reorgMartin Odersky2015-05-0227-47/+47
| | | | | | | | | | | | | | | | | | | | | The pickling package got rather large and confusing with three separate tasks that each had their own conventions: read JVM classfiles, read Scala2 pickle info, read Tasty. The classes for each task are now in separate packages.
* | | Merge pull request #526 from dotty-staging/fix/#522odersky2015-05-034-2/+8
|\ \ \ | | | | | | | | Fix #522.
| * | | Moved tests from pendingMartin Odersky2015-05-033-5/+0
| | | |
| * | | Fix #522.Martin Odersky2015-05-032-2/+13
| | | | | | | | | | | | | | | | | | | | We were missing a substitution in full parameterization. Embarraingly, this made even the example in the doc comment of `fullyParameterizedDef` fail.
* | | | Merge pull request #527 from smarter/enable/strip-tvars-testodersky2015-05-032-3/+3
|\ \ \ \ | |/ / / |/| | | Enable test strip-tvars-for-lubbasetypes.scala and disable debug message
| * | | addToConstraint: Disable debug message by defaultGuillaume Martres2015-05-031-1/+1
| | | |
| * | | Enable test strip-tvars-for-lubbasetypes.scalaGuillaume Martres2015-05-031-2/+2
|/ / / | | | | | | | | | | | | The test had to be slightly modified because of dotty's stricter checking of type bounds validity, see #525 where this was discussed.
* | | Merge pull request #524 from dotty-staging/fix/#523Dmitry Petrashko2015-05-022-1/+10
|\ \ \ | |/ / |/| | Fix #523: Instantiate lower bound when bounds checking
| * | Fix #523: Instantiate lower bound when bounds checkingMartin Odersky2015-05-022-1/+10
|/ / | | | | | | | | | | | | | | Lower bounds need to be instantiated just like upper bounds. F-bounded polymorphism (which only applies too upper bounds) is one reason for instantiating arguments, but parameters referring to other parameters is another one. An the latter applies to lower bounds as well.
* | Merge pull request #507 from dotty-staging/add/from-tastyDmitry Petrashko2015-05-0213-87/+228
|\ \ | | | | | | Compile from Tasty
| * | Force TASTY trees read by unpickler in FromTastyMartin Odersky2015-04-301-0/+6
| | | | | | | | | | | | | | | We want to ensure that the whole tree is read at phase frontend. To achieve this, we run an empty traverser over the tree.
| * | Move addrOfTree, addOfSym from CompilationUnit to Pickler.Martin Odersky2015-04-283-16/+18
| | | | | | | | | | | | | | | These only exist if there was a pickler, and they are not unique per CompilationUnit.
| * | Add usage documentation to FromTastyMartin Odersky2015-04-281-0/+11
| | |
| * | Handle missing delta positions when unpicklingMartin Odersky2015-04-283-9/+9
| | | | | | | | | | | | | | | | | | A missing delta position signifies that the node has the same position as its parent. Once that case was added, we can now enable positions when reading from Tasty.
| * | Maintain source files in pickled infoMartin Odersky2015-04-285-17/+31
| | | | | | | | | | | | | | | | | | | | | So far: Only one source file is recorded. Should evaluate whether more are needed. Will programs composed from several source files be pickled? They will certainly be generated after inlining, but maybe all that happens after pickling?
| * | Unpickler should not label parameter accessors Deferred.Martin Odersky2015-04-281-1/+1
| | |
| * | Fix definition of empty package so that it can persist membersMartin Odersky2015-04-281-2/+3
| | | | | | | | | | | | | | | | | | Previously, the empty package was always initialized with the empty scope. This means that separate compilation between files in the empty package was not possible.
| * | Compiler for embedded TASTY info.Martin Odersky2015-04-283-16/+112
| | | | | | | | | | | | `FromTasty` is a main module which compiles TASTY info instead of sources.
| * | ClassfileParser and SymbolLoader should return embedded unpicklersMartin Odersky2015-04-284-35/+46
| | | | | | | | | | | | | | | | | | To be able able to post process pickled TASTY tree we let ClassfileParser#run return any embedded unpickler. The unpickler is further propagated by a new method ClassFileLoader#load in SymbolLoaders.
| * | Rename Unpickler -> Scala2UnpicklerMartin Odersky2015-04-282-5/+5
| | |
* | | Merge pull request #411 from smarter/add/value-classesDmitry Petrashko2015-05-0146-192/+617
|\ \ \ | |_|/ |/| | Implement value classes
| * | Erasure: Box closures of value classes when neededGuillaume Martres2015-05-012-1/+53
| | | | | | | | | | | | | | | | | | After erasure, we may have to replace the closure method by a bridge. LambdaMetaFactory handles this automatically for most types, but we have to deal with boxing and unboxing of value classes ourselves.
| * | Fix companionClass not working after Erasure for value classesGuillaume Martres2015-05-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a module class V$, the synthesized companion class method looks like: val companion$class: V If V is a value class, after erasure it will look like: val companion$class: ErasedValueType(V, ...) This will break SymDenotation#companionClass which relies on the type of companion$class. The solution is to not semi-erase the type of companion$class.
| * | Enable pending pos tests related to value classesGuillaume Martres2015-05-015-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each test needs to have its own package because pos_all will try to compile the whole valueclasses directory at once. The remaining tests with "extends AnyVal" in tests/pending/pos are related to separate compilation, except for: - t6482.scala and t7022.scala which were fixed by https://github.com/scala/scala/pull/1468 in scalac and seem to trigger a similar bug in FullParameterization - strip-tvars-for-lubbasetypes.scala which was fixed by https://github.com/scala/scala/pull/1758 in scalac
| * | Enable untried pos tests related to value classesGuillaume Martres2015-05-0123-33/+33
| | | | | | | | | | | | | | | Each test needs to have its own package because pos_all will try to compile the whole valueclasses directory at once.
| * | New phase: VCInline which inlines value classes callsGuillaume Martres2015-05-014-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | This corresponds roughly to step 2 of SIP-15 and to the peephole optimizations of step 3. The extractors in TreeExtractors are copied or inspired from src/compiler/scala/tools/nsc/ast/TreeInfo.scala in scalac.
| * | Make ExtensionMethods#extensionMethods an object methodGuillaume Martres2015-05-013-68/+76
| | | | | | | | | | | | This method will be needed to implement VCInline.
| * | Erasure: properly handle null in value classesGuillaume Martres2015-05-014-9/+54
| | | | | | | | | | | | This fixes the issues reported in SI-5866 and SI-8097
| * | New phase: ElimErasedValueTypeGuillaume Martres2015-05-012-1/+84
| | | | | | | | | | | | | | | This phase erases ErasedValueType to their underlying type, in scalac this was done in PostErasure.
| * | Erasure: properly erase value classesGuillaume Martres2015-05-015-27/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three ways to erase a value class: - In most case, it should be semi-erased to an ErasedValueType, which will be fully erased to its underlying type in ElimErasedValueType. This corresponds to semiEraseVCs = true in TypeErasure. - In a few cases, it should be erased like a normal class, so far this seems to be necessary for: * The return type of a constructor * The underlying type of a ThisType * TypeTree nodes inside New nodes * TypeApply nodes * Arrays In these cases, we set semiEraseVCs = false - When calling `sigName` it should be erased to its underlying type. This commit implements all these cases. Note that this breaks most tests because ElimErasedValueType has not been implemented yet, it is part of the next commit.
| * | Add synthetic casts to and from ErasedValueTypeGuillaume Martres2015-05-014-7/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a value class V, let U be the underlying type after erasure. We add to the companion object of V two cast methods: def u2evt$(x0: U): ErasedValueType(V, U) def evt2u$(x0: ErasedValueType(V, U)): U The casts are used in Erasure to make it typecheck, they are then removed in ElimErasedValueType (not yet present in this commit). This is different from the implementation of value classes in Scala 2 (see SIP-15) which uses `asInstanceOf` which does not typecheck.
| * | RefinedPrinter: Pretty-print ErasedValueTypeGuillaume Martres2015-05-011-0/+3
| | |
| * | Cache the instantiations of ErasedValueTypeGuillaume Martres2015-05-011-2/+25
| | | | | | | | | | | | | | | This reduces the number of objects created and speeds up subtyping tests Also make ErasedValueType extend ValueType
| * | TypeComparer: Add support for ErasedValueTypeGuillaume Martres2015-05-011-0/+8
| | |
| * | TypeErasure: replace isSemi by semiEraseVCs and simplify the codeGuillaume Martres2015-05-011-30/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - isSemi is replaced by semiEraseVCs with a different meaning (but is still unimplemented): * If true, value classes are semi-erased to ErasedValueType (they will be fully erased in ElimErasedValueType which is not yet present in this commit). * If false, they are erased like normal classes. - Fix the documentation of the TypeErasure class which was wrong. - Remove intermediate functions scalaErasureFn, scalaSigFn, javaSigFn and semiErasureFn. It's clearer to just use erasureFn directly instead. - Add an optional parameter semiEraseVCs to TypeErasure#erasure which will be used in Erasure#Typer when we need to disable semi-erasure.
| * | TypeErasure: simplify and fix bugsGuillaume Martres2015-05-012-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit tries to disentangle the TypeErasure class and the TypeErasure object thereby fixing #386. - Remove the `eraseInfo` method in the TypeErasure object, use `transformInfo` instead which takes care of using the correct instance of TypeErasure depending on the symbol to erase. - Remove the unused method `eraseResult` in the TypeErasure class. - In `transformInfo`, use the correct instance of the TypeErasure class when calling `eraseInfo`. - In the `eraseInfo` method of the TypeErasure class, do not call the `erasure` method of the TypeErasure object, instead use the `apply` method of the current instance of TypeErasure.