aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Replace some idents by selects in LambdaLiftMartin Odersky2014-10-261-2/+5
| | | | | If a symbol becomes a class field, references to it need to be selections, or else we get a "bad type" assertion violation in TreeChecker.
* Initialize lambda lift mapsMartin Odersky2014-10-261-0/+6
| | | | | | ... so that they do not spill over between compilation units. It would be better to wipe the maps after processing a compilation unit, but right now we do not have a hook for that. A better solution should be possible once we replace init by "prepareUnit/transformUnit".
* Strenghten postCondition of firstTransformMartin Odersky2014-10-261-0/+3
| | | | All tests pass, but good to have the condition in there.
* Fixes erasure of superMartin Odersky2014-10-261-1/+3
| | | | | | - supertype components needs to be recursively erased Without this fix, some files do not pass -Ycheck:lambdaLift
* LambdaLift checks now explicitly for references to labels outside scope.Martin Odersky2014-10-262-3/+7
| | | | | Nested methods cannot refer to labels in theior environment. Needs a fix in TailCalls. Moved failing test to pending.
* SuperTypes are now promoted in Retyper; lambdaLift fails to Ycheck otherwise.Martin Odersky2014-10-261-0/+3
|
* Added missing case for SuperTypes to TypeComparerMartin Odersky2014-10-261-0/+8
|
* Fixes to LambdaLiftMartin Odersky2014-10-262-10/+17
| | | | Several fixes to LambdaLift. The test suite now succeeds with LambdaLift enabled.
* Fix to enclosingClassMartin Odersky2014-10-261-4/+10
| | | | | | | The skip logic in enclosing class worked only when the original symbol was labelled inSuperCall. The patch makes it work also for symbols that are in turn owned by an inSuperCall symbol. Also it treats JavaStatic terms as also not being enclosed by the lexically enclosing class.
* Two fixes to avoid scanning package contentsMartin Odersky2014-10-262-2/+3
| | | | | typeParams and outerAccessor both potentially scan all declarations of a class. The fixes make sure this is never done for packages.
* Fix flatten problem in erasureMartin Odersky2014-10-261-5/+4
| | | | Statement sequences need to be flattened after processing, not before.
* Rename flag Static -> JavaStaticMartin Odersky2014-10-265-10/+12
| | | | | | Static has two meanings: In the Java sense, and in the Scala sense, where it means a member of a package or static module. The change makes it clear that the flag means Static in the Java sense.
* Implement findMember for JavaArraysMartin Odersky2014-10-261-0/+2
| | | | ... by forwarding to Object. Without this, LambdaLift fails for core/Contexts.scala.
* Fix to TreeTypeMapMartin Odersky2014-10-262-31/+19
| | | | | | | Now handles the case where a class symbol itself is not changed by the map, but one of its declarations is. In this case we need to back out, and create new symbols for the class and all other symbols that are defined in the same scope as the class.
* TreeTypeMap needs to map declarations of mapped classesMartin Odersky2014-10-263-13/+42
| | | | | | | | ... and these mappings have to be part of the applied substitutions. Without the patch, the postCondition of FirstTransform fails for TreeInfo.scala and others, because it selects symbols which are not defined in the mapped class. Unrelated bugfix: JavaArray derives from Object.
* Insert .package for package object referencesMartin Odersky2014-10-261-1/+18
| | | | | | | | Package object members are seen as members of the enclosing package during typer. The normalization inserts the missing .package reference to such members. It is necessary to satisfy a new postcondition of FirstTransform: In a selection `x.m`, the type of `x` must derive from the owner of `m`.
* More assertions in TreeChecker.Martin Odersky2014-10-262-5/+8
| | | | Flushed out a caching bug in Scopes.
* Avoid hoisting local classesMartin Odersky2014-10-267-16/+48
| | | | | | | | | | | | The patch disables hoisting of classes local to a block into the result type of the block. Instead, we widen the result type of the block to one which reflects all refinements made to the parents type of the local class. Test cases in avoid.scala, t1569.scala. The original t1569.scala no longer works. Why is explained in neg/t1569-failedAvoid.scala
* Add echo method to printers.Martin Odersky2014-10-261-0/+2
| | | | | | | | | | | | | | It's often useful to print a value as it is returned. This method avoids the temporary variable to hold the vaue before it is printed and then return. I.e. printer.echo(msg, expr) instead of val x = expr printer.println(msg + x) x
* Merge pull request #189 from dotty-staging/mergeDmitry Petrashko2014-10-2263-493/+1717
|\ | | | | constructors & getters-setters
| * Disable LambdaLiftMartin Odersky2014-10-171-2/+2
| | | | | | | | to get a working baseline build
| * Erasure casting should perform primitive conversionsMartin Odersky2014-10-171-2/+2
| | | | | | | | | | | | After erasure, asInstanceworks only bedtween reference types, so erasure is not allowed to insert asInstanceOfs between numeric types. Previously this made t1260 fail even if LambdaLift is disabled.
| * Test for patmat action on a @ Bind(_, Typed(_: Unapply, _)Dmitry Petrashko2014-10-141-0/+3
| |
| * Quickfix patmat not handling Bind(_, Typed(_: Unapply))Dmitry Petrashko2014-10-131-0/+1
| | | | | | | | | | | | Typer creates a tree that given current decoding scheme means case a @ (Assign(Ident(id), rhs) : tpt) Which isn't valid scala.
| * Get rid of Substitution.Dmitry Petrashko2014-10-131-116/+74
| | | | | | | | | | | | | | Substitution was creating more problems than solving. Instead the symbols in tree aren't rewriten anymore, and pattern matcher collects Rebindings and generates ValDefs for them just before the guard & body of the generated case.
| * EqualityTestTreeMaker: fix incorrect type of symbolDmitry Petrashko2014-10-131-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | given a pattern object b x match { case y @ b => <body> } y inside the <body> `y` should have type b.type. Inherited from scalac EqualityTestTreeMaker would reset type of it in order to achive this. Dotty instead needs to know this in advance.
| * Better diagnostic from LambdaLiftMartin Odersky2014-10-131-2/+9
| |
| * Disambiguate names in test caseMartin Odersky2014-10-131-3/+3
| |
| * Remove special treatment of SubstOnlyTreeMakers.Dmitry Petrashko2014-10-131-17/+32
| | | | | | | | | | | | | | | | In scalac SubstOnlyTreeMakers were implemented using substitution, and didn't actually introduce new trees. Thus there was an optimization to remove them while generating code. This optimization led to #190. It is now removed.
| * More refined printing optionsMartin Odersky2014-10-133-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using RefinedPrinter we now have a choice whether when printing a definition tree such as def foo(x: T): U we print the parameter and result type info found in the tree or in the symbol. Previously, we printed the sym info when after typer and the tree info before. This turns out to be too inflexble. With the patch, we print the sym info if option -Yprint-syms is set, and the tree info otherwise. Also, align -Yno-deep-subtypes from camelCase to standard hyphenated option notation. Tweak where unique ids are printed.
| * Initial lambda lifterMartin Odersky2014-10-132-2/+399
| |
| * Patmat: fix negation left from isEmpty&fix scopingDmitry Petrashko2014-10-131-5/+3
| | | | | | | | Should fix #188
| * Adaptations to make pattern matcher in new worldMartin Odersky2014-10-128-24/+11
| | | | | | | | | | | | | | | | | | | | Tests now always include erasure (before quite a few tests failed when erasure was enableed). By contrast lazy vals creates problems with erasure, disabled for now. Some other small polishings on integration of pattern matcher with rest of dotc. Deep recompilation of tools still fails, currently disabled.
| * move caseAccessors from TypeUtilsDmitry Petrashko2014-10-122-5/+3
| | | | | | | | They are in SymUtils
| * Remove appliedIfMethod use ensureApplied insteadDmitry Petrashko2014-10-122-17/+10
| |
| * Rename explicitOuter to explicitOuterPhase in PhasesDmitry Petrashko2014-10-122-2/+2
| |
| * Avoid capturing an old context in Classfile#typeParamCompleterMartin Odersky2014-10-121-2/+4
| | | | | | | | | | Previously caused an illegal backwards timetravel in bringForward when compiling all files in tools together twice.
| * Make Scala2Existentials valid foreverMartin Odersky2014-10-121-1/+1
| | | | | | | | Avoids a stale symbol error when compiling all files in tools together.
| * Avoid generating Any in erasedLubsMartin Odersky2014-10-121-2/+2
| | | | | | | | ... because Any is not an erasedType (this is now checked)
| * TypeTestCasts should test and cast wrt erased typesMartin Odersky2014-10-121-3/+4
| |
| * Moved caseAccessors to SymUtilsMartin Odersky2014-10-122-2/+5
| |
| * Fix bug in varianceInTypeMartin Odersky2014-10-121-4/+3
| |
| * Make widening ops more systematic & completeMartin Odersky2014-10-121-2/+2
| | | | | | | | | | 1) strip TypeVars where necessary before widening 2) allow the combination of widening and dealiasing, in any order.
| * Fix typing of _* patterns.Martin Odersky2014-10-121-0/+1
| | | | | | | | And bring back two tests for typing of patterns
| * Bring back lost AccessorCreationFlagsMartin Odersky2014-10-121-0/+3
| | | | | | | | Was lost in merge chaos between pattern macther and rest
| * New testsMartin Odersky2014-10-1210-0/+179
| |
| * Enabled GettersSetters phase.Martin Odersky2014-10-124-20/+28
| |
| * Don't adapt to FunProto in TreeChecker.Martin Odersky2014-10-121-1/+2
| | | | | | | | | | | | Similar to Erasure, we do not check conformance wrt <:< to a FunProto. Nothing is lost, because we typecheck the arguments and result anyway. And this led to failing tests after GettersSetters was added.
| * Replace typed with typedUnadapted.Martin Odersky2014-10-121-1/+1
| | | | | | | | | | | | | | 1) Avoids unneccessary second adapt. 2) Avoids error when used in TreeChecking when we try to compare types in previous tree and new tree - if we used `typed`, the previous tree would not have a type!
| * Avoid caching NoDenotations in NamedTypesMartin Odersky2014-10-121-1/+6
| |