aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform
Commit message (Collapse)AuthorAgeFilesLines
...
| * Refactorings of GenericTypes and underlying/upperboundMartin Odersky2016-07-112-8/+2
| | | | | | | | | | | | | | 1. Make genericType a trait instead of a class. 2. Make TypeLambda a type proxy 3. Split underlying in TypeProxy into underlying and superType 4. Cleanups in many other places
| * Handle signatures over uninstantiated type variablesMartin Odersky2016-07-111-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Taking the signature over a type with uninstantiated type variables means that the signature can change later, once we instantiate the type variable. We handle this by recording uninstantiated positions of signatures and fixing them in PostTyper, when type variables are instantiated. - This allows to drop the kludge of "normalizing" in derivedRefinedType Dropping this initially revealed the problems with under-determined signatures. Now that these problems are fixed, we can drop for good.
| * Refactoring of PolyType and TypeLambdaMartin Odersky2016-07-112-7/+7
| | | | | | | | | | | | | | Make them each inherit from common BaseType GenericType. That way we avoid inheriting accidentally stuff from PolyType in TypeLambda. Also, Fix adaptation of type lambdas. Don't confuse them with PolyTypes.
* | Correct typo in IsInstanceOfEvalautor, fixes #1352Felix Mulder2016-07-141-2/+2
|/
* Merge pull request #1315 from nicolasstucki/optimize-try-casesDmitry Petrashko2016-06-302-74/+101
|\ | | | | Fix #856: Handle try/catch cases as catch cases if possible.
| * Fix #856: Handle try/catch cases as catch cases if possible.Nicolas Stucki2016-06-282-74/+101
| | | | | | | | | | | | | | Previously they were all lifted into a match with the came cases. Now the first cases are handled directly by by the catch. If one of the cases can not be handled the old scheme is applied to to it and all subsequent cases.
* | Merge pull request #1338 from dotty-jvican/non-deferred-ycheckDmitry Petrashko2016-06-301-0/+21
|\ \ | |/ |/| Check non-deferred declarations are implemented
| * Add postcondition check that ensures #971jvican2016-06-291-0/+21
| |
* | Make class initialisers private. Otherwise they break GenBCode.Dmitry Petrashko2016-06-071-1/+1
| | | | | | | | | | GenBCode checks if class already has static initialiser, the check is fooled if class inherited a static initialisers.
* | MoveStatics: Fix classes without companion not getting static <clinit>Dmitry Petrashko2016-06-071-19/+20
| | | | | | | | This broke lazy vals, as unsafe offsets were not initialised.
* | LazyVals: fix leftover moduleClass usage.Dmitry Petrashko2016-06-071-1/+1
| |
* | CheckStatic: report error position in case of disallowed overrideDmitry Petrashko2016-06-071-1/+1
| |
* | MoveStatics: fix a bug.Dmitry Petrashko2016-06-071-1/+2
| | | | | | | | Nicely spotted by Ycheck.
* | MoveStatics: survive absence of companions.Dmitry Petrashko2016-06-071-14/+24
| | | | | | | | | | | | | | Now moveStatics can correctly create static constructors for objects. Those static constructors would later be merged with synthetic module initialisers by GenBCode. This is a bit of magic, it would be good to move all this into this phase.
* | MoveStatics: fix two bugs.Dmitry Petrashko2016-06-071-1/+2
| | | | | | | | | | Unlink the static from the old scope, and don't drop top-level trees that are not TypeDefs.
* | LazyVals: do not share offsets between companions.Dmitry Petrashko2016-06-071-12/+9
| | | | | | | | | | | | There used to be a rare test when companion class and companion object would have gotten the very same offset, causing undefined behaviour in runtime.
* | Fix #1224: static members do not override\implement parent symbols.Dmitry Petrashko2016-06-071-3/+5
| |
* | Drop support for @static lazy vals.Dmitry Petrashko2016-06-071-0/+3
| | | | | | | | It's not clear how they should be implemented.
* | MoveStatic: Move static methods & fields into companion classDmitry Petrashko2016-06-071-0/+64
| | | | | | | | | | | | | | As a funny side-effect this allows to execute arbitrary code in static initialisers: @static val a: Unit = {println("loaded")}
* | Allow creating static initialisers.Dmitry Petrashko2016-06-071-1/+4
| |
* | Getters: do not generate getters for static valsDmitry Petrashko2016-06-071-0/+1
| |
* | Constructors: do not lift static val initialisation into constructors.Dmitry Petrashko2016-06-071-2/+2
| |
* | Fix #1220. Dont die when having incorect static methodsDmitry Petrashko2016-06-071-7/+4
|/
* Fix #1292: give position when failing to emit switch on annotated matchFelix Mulder2016-06-021-1/+1
| | | | | | | | | | | | | | | | This fix gives the position and refactors the code that gave off warnings, but it also begs the question - should we be able to handle emitting a switch for the following case: ```scala (x: @switch) match { case 'a' if somePredicate(x) => // ... case 'b' => // ... } ``` Currently if there is a guard, the patternmatcher will fail to emit a switch. Scalac can handle these cases currently.
* Merge pull request #1281 from dotty-staging/fix-lamda-liftodersky2016-05-272-6/+16
|\ | | | | Fixes to lambdalift that prevent memory leaks.
| * LambdaLift: do not close over members that are static.Dmitry Petrashko2016-05-271-2/+2
| |
| * Fix deadlock in t5375 and similar tests.Dmitry Petrashko2016-05-261-2/+3
| | | | | | | | See t5375.scala for details.
| * Backport from Linker: ElimStaticThis: allow more calls to static methodsDmitry Petrashko2016-05-261-2/+4
| | | | | | | | | | | | | | Before there was an implicit assumption that static methods are only present on objects. This assumption is invalidated both by linker optimizations and the new fix to lambdalift.
| * Backport from Linker: Fix to lambda lift. Fixes #1280.Dmitry Petrashko2016-05-261-2/+9
| | | | | | | | | | | | | | | | | | | | | | CollectDependencies had incorrect handling of `Ident`s. If it had ever met an `Ident` to a symbol defined outside of current owner-chain(e.g. Predef.println) it would issue narrowTo(enclosingClass). This is very conservative and leads to memory leaks even in trivial lambdas. My lambda-lift-foo groes stronger :-)
* | Annotate repeated params with `case` flag to indicate that they are legalFelix Mulder2016-05-271-2/+10
| | | | | | | | | | | | | | One drawback with this approach is that the type seems to propagate. I.e. if the return type of an expression is `repeated` then the enclosing variable will get the `repeated` type instead of getting the expected `Seq` type
* | Change typer to infer repeated param instead of Seq in `_*` casesFelix Mulder2016-05-271-2/+3
| |
* | Merge pull request #1270 from dotty-staging/fix-bootstrapDmitry Petrashko2016-05-274-25/+16
|\ \ | | | | | | Fix bootstrap
| * | Decouple annotation transformers from info transformersMartin Odersky2016-05-234-25/+16
| | |
* | | Merge pull request #1256 from felixmulder/topic/test-bcodeDmitry Petrashko2016-05-271-3/+5
|\ \ \ | | | | | | | | Add bytecode checking infrastructure
| * | | Move `stripAnnots` to `isRef` instead of performing explicitly everywhereFelix Mulder2016-05-191-11/+5
| | | |
| * | | Fix #1258: correct behavior for annotated valuesFelix Mulder2016-05-171-5/+13
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Annotated values are encapsulated in a `ConcreteAnnotation`, as such, the statement `tpe isRef defn.IntClass` would yield false despite the annotated reference being an Int. The tpe is now unwrapped if it has an annotation. If the transformation fails despite having the annotation the compiler will warn.
* | | Fix double evaluation of scrutinee with side-effects, add testFelix Mulder2016-05-261-10/+7
| | |
* | | Take side-effects into account during rewritingFelix Mulder2016-05-261-5/+10
| | |
* | | Don't evaluate isInstanceOf for value classes, disable bugged testsFelix Mulder2016-05-261-27/+36
| | | | | | | | | | | | | | | | | | | | | The tests `i1059.scala` and `t3480.scala` are failing due to a bug in pattern matcher that evaluates the `x` in `List(x: _*)` incorrectly. Concerned issue: #1276
* | | Address reviewer feedbackFelix Mulder2016-05-261-10/+19
| | |
* | | Fix primitive rewritingFelix Mulder2016-05-261-1/+1
| | |
* | | Rewrite `TypeApply` to null-check on rewrite to true, add docstringsFelix Mulder2016-05-261-23/+82
| | |
* | | Add initial partial evaluation of isInstanceOf callsFelix Mulder2016-05-262-2/+91
| | |
* | | Safe equality for core classes:Martin Odersky2016-05-231-1/+1
| |/ |/| | | | | | | | | | | Name, Symbol, Denotation, Type. This uncovered two nonsensical comparisons, one in CollectEntryPoints, the other in DottyBackendInterface.
* | Refined handling of atSignatureMartin Odersky2016-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | We cannot throw a merge error if atSignature does not give a unique single denotation. Counter example is compiling dotty itself, where we get a false negative during bridge generation. Instead, atSigature needs to return a normal denotation, and we need to check separately where required that a denotation is in fact a SingleDenotation.
* | Issue MergeError exception for double def situationsMartin Odersky2016-05-181-32/+36
| | | | | | | | | | | | | | | | When finding two symbols in the same class that have the same signature as seen from some prefix, issue a merge error. This is simpler and more robust than the alternative of producing an overloaded denotation and dealing with it afterwards.
* | Don't copy Any constructor to Object in ErasureMartin Odersky2016-05-181-3/+9
|/ | | | | | | | Once we do not merge methods with same signature anymore we got an ambiguous overload between the constructors of Any and Object after erasure (when all Any methods are moved to Object). To avoid this, we map the Any constructor to the Object constructor after erasure.
* eliminate self symbol in Template and ClassInfoliu fengyun2016-05-021-2/+16
|
* Transform annotations only if defined in current runMartin Odersky2016-04-291-4/+11
| | | | | | | | There's no point transforming annotations that come from classfiles. It's inefficient to do so and it's also risky because it means we'd have to make sense of Scala-2 generated trees. This should avoid the error in #1222.
* Rename Reporting#println -> Reporting#echoMartin Odersky2016-04-271-8/+8
| | | | | | | | | | There's a trap otherwise that, when in a class inheriting from Context (and with it Reporting) a call to println will go to this.println and therefore might not print at all, if the current context buffers messages. I lost a lot of time on this on several occasions when I scratched my head why a simple debug println would not show. Better avoid this in the future for myself and others.