aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Pass right prototype to SeqLiteral elements.Martin Odersky2014-12-051-0/+4
|
* Add new SeqLiterals phase.Martin Odersky2014-12-032-0/+50
| | | | | Replaces SeqLiterals by JavaSeqLiterals, because the latter's (array-)type is preserved after erasure.
* Replace `==` with `eq` when determining unique typesMartin Odersky2014-12-031-4/+5
| | | | | | | | | | | | | | | | | | When hash-consing TypeBounds, RefinedTypes and NamedTypes, we now check the argument types with `eq`, where before it was `==`. This is necessary for TypeBounds, because it makes a difference whether a TypeBound has `eq` parts (then it is a type alias) or not. So we cannot merge type aliases with non-aliases. The symptom of the problem was when compiling Patterns.scala twice with the new SeqLiterals phase (next commit) enabled. On second run, we encountered an ArrayType[>: String <: String], even if we only created an ArrayType[String]. This was a consequence of the two types being identified by uniques. Todo: Change the system so that type aliases are recognized more robustly. But the present change seems to be useful anyway because it speeds up uniques hashing. I verified that the stricter condition on uniques creates less than 1% more types than before. So the speedup of hashing looks worthwhile.
* Simplification in type assigning SeqLiteralsMartin Odersky2014-12-032-2/+1
|
* made ArrayType constructor phase awareMartin Odersky2014-12-031-1/+2
| | | | | | | | | Avoid to create ArrayTypes after erase. Note that the *extractor* does not recognize JavaArrayTypes as ArrayTypes. Doing so would create an infinite loop in sigName. Generally, we do not want to ppaper over the difference when analysing types.
* Merge pull request #259 from dotty-staging/fix/tree-transforms-seq-literalodersky2014-12-031-1/+1
|\ | | | | Fix TreeTransfrom ignoring SeqLiterals.
| * Fix TreeTransfrom ignoring SeqLiterals.Dmitry Petrashko2014-12-031-1/+1
|/
* Merge pull request #254 from dotty-staging/fix/newArray-v2Dmitry Petrashko2014-12-0112-15/+121
|\ | | | | Fix array creation v2
| * Previous scheme was buggy; leaked Array types to backend.Martin Odersky2014-11-2812-15/+121
| | | | | | | | | | | | Now: All new Array[T] methods are translated to calls of the form dotty.Arrays.newXYZArray ...
* | Merge pull request #242 from dotty-staging/fix/mixinsDmitry Petrashko2014-11-264-14/+20
|\ \ | |/ |/| Fix/mixins
| * Allow deep subtypes in dotc_transform.Martin Odersky2014-11-261-1/+1
| | | | | | | | The clause got accidentally dropped in the rebase.
| * Removed println's left accidentally in code base.Martin Odersky2014-11-261-2/+0
| |
| * Fixed data race in ResolveSuperMartin Odersky2014-11-263-12/+16
| | | | | | | | | | | | | | | | | | | | The datarace happened because for method "transform" implemented by ResolveSuper which disambiguated overridden methods. Previously, there was a reference FirstTransform.this.transform of type termRefWithSig to the method implemented in a super trait. Now the same reference points to the newly implemented method. Solved because ResolveSuper now generates symbolic references.
| * Fix of intersection not emptyMartin Odersky2014-11-261-2/+6
| | | | | | | | The bug caused new version of FirstTransform to compile with errors.
* | Merge pull request #244 from dotty-staging/fix/refinementTypes-v2odersky2014-11-265-8/+103
|\ \ | |/ |/| Allow refinements that refine already refined types.
| * Allow refinements that refine already refined types.Martin Odersky2014-11-265-8/+103
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a double definition errorfor `T` was produced in a case like this: type T1 = C { T <: A } type T2 = T1 { T <: B } This was caused by the way T1 was treated in the refinement class that is used to typecheck the type. Desugaring of T2 with `refinedTypeToClass` would give trait <refinement> extends T1 { type T <: B } and `normalizeToClassRefs` would transform this to: trait <refinement> extends C { type T <: A; type T <: B } Hence the double definition. The new scheme desugars the rhs of `T2` to: trait <refinement> extends C { this: T1 => type T <: B } which avoids the problem. Also, added tests that #232 (fix/boundsPropagation) indeed considers all refinements together when comparing refined types.
* Merge pull request #238 from dotty-staging/fix/bounds-propagation-v2odersky2014-11-2623-164/+406
|\ | | | | Fix/bounds propagation v2
| * Added test case from SI-6169Martin Odersky2014-11-251-0/+69
| |
| * Simpler cycle detectionMartin Odersky2014-11-244-23/+20
| | | | | | | | | | | | | | | | | | | | | | Turns out that the last commit was a red herring. None of the hoops it jumped though was necessary. Instead there was a bug in isRef which caused `&` to erroneously compute T & Int as Int. The bug was that we always approximated alias types by their high bound. But in the present case, this leads to errors because U gets 'bounds >: Nothing <: Any', but it was still an alias type (i.e. its Deferred flag is not set). The fix dereferences aliases only if their info is a TypeAlias.
| * Fixed cycle detection.Martin Odersky2014-11-244-2/+34
| | | | | | | | Now detects the cycles reported by @retronym
| * Cyclicity checking independent of positions.Martin Odersky2014-11-241-1/+5
| | | | | | | | More robust cyclicity check which does not depend on source positions.
| * Added and corrected testsMartin Odersky2014-11-243-3/+7
| | | | | | | | to reflect last commit.
| * Updated refinement checking.Martin Odersky2014-11-242-8/+50
| | | | | | | | Toucher checks, but only deprecated warnings instead of errors.
| * Better printing of variant types with wildcard arguments.Martin Odersky2014-11-243-6/+31
| | | | | | | | | | We used to approximate these by their bounds, but this is confusing. See comment in printbounds.scala.
| * checkBounds refactoringMartin Odersky2014-11-244-30/+44
| | | | | | | | | | | | Move core logic to TypeOps, only leave error reporting in Checking. That way, we have the option of re-using the code as a simple test elsewhere.
| * Take off the training wheels for refined type comparisons.Martin Odersky2014-11-241-19/+2
| |
| * Fix to checkBoundsMartin Odersky2014-11-243-4/+16
| | | | | | | | | | Need to account for the fact that some argument types may be TypeBoudns themselves. The change makes Jason's latest example work.
| * Fixes in TypeComparer for RefinedTypes.Martin Odersky2014-11-248-70/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous scheme did not propagate bounds correctly. More generally, given a comparison T { X <: A } <: U { X <: B } it would errenously decompose this to T <: U, A <: B But we really need to check whether the total constraint for X in T { X <: A } subsumes the total constraint for X in T { X <: B } The new scheme propagates only if the binding in the lower type is an alias. E.g. T { X = A } <: Y { X <: B } decomposes to T { A = A } <: U, A <: B The change uncovered another bug, where in the slow path we too a member relative to a refined type; We need to "narrow" the type to a RefinedThis instead. (See use of "narrow" in TypeComparer). That change uncovered a third bug concerning the underlying type of a RefinedThis. The last bug was fixed in a previous commit (84f32cd814f2e07725b6ad1f6bff23d4ee38c397). Two tests (1048, 1843) which were pos tests for scalac but failed compling in dotc have changed their status and location. They typecheck now, but fail later. They have been moved to pending. There's a lot of diagnostic code in TypeComparer to figure out the various problems. I left it in to be able to come back to the commit in case there are more problems. The checks and diagnostics will be removed in a subsequent commit.
| * Changed underlying type of RefinedThisMartin Odersky2014-11-241-1/+1
| | | | | | | | | | | | | | Now: The underlying refined type. Was: The parent of the type. We need the change because RefinedThis is used as a narrowed version of the underlying refinedType (e.g. in TypeComparer rebase), and the old scheme would lose a binding of that type.
| * More robust isSetter test.Martin Odersky2014-11-241-1/+1
| | | | | | | | Avoids cyclic references caused by forcing info too early.
| * More robust TypeVar printing.Martin Odersky2014-11-241-3/+7
| | | | | | | | | | Avoid the crash if origin is not associated with a bound in the current constraint.
| * Fixed type adaptation problem in checkBoundsMartin Odersky2014-11-242-1/+21
| | | | | | | | | | | | | | We need to adapt type parameter bounds with an as-ssen-from to the prefix of the type constructor. Makes pos/boundspropagation pass.
| * Make reduceProjection use lookupRefinedMartin Odersky2014-11-242-70/+49
| | | | | | | | | | | | | | | | | | | | | | Needed some fixes to lookup refined. The potential alias type is now calculated by taking the member of the original refined type, instead of by simply following the refined info. This takes into account refinements that were defined after the refinement type that contains the alias. The change amde another test (transform) hit the deep subtype limit, which is now disabled.
| * Improve simplifications of type projections.Martin Odersky2014-11-242-1/+40
|/ | | | | | | | | | An example where this helps: Previously, the private value `mnemonics` in Coder.scala was fof the form Lambda$IP { ... } # Apply It now simplifies to a Map[...] type.
* Merge pull request #213 from dotty-staging/javaparserDmitry Petrashko2014-11-24117-271/+2150
|\ | | | | Javaparser & ElimRepeated fixes & Annotation-fixes
| * Do not skip packages in FirstTransformDmitry Petrashko2014-11-221-1/+2
| | | | | | | | Packages also get a JavaDefined flag, but they shouldn't be removed by FirstTransform.
| * Drop java-defined trees in FirstTransformDmitry Petrashko2014-11-221-1/+5
| |
| * Address reviewer feedback: restructure applyOverloaded.Dmitry Petrashko2014-11-221-7/+14
| |
| * Enabling java testsDmitry Petrashko2014-11-221-5/+5
| |
| * Moving java tests to posDmitry Petrashko2014-11-2283-0/+5
| |
| * Fixing memoize transforming java fields.Dmitry Petrashko2014-11-221-1/+1
| |
| * Adapting branch to absence of modifiers in trees.Dmitry Petrashko2014-11-224-56/+29
| |
| * Add handling of parsed annotations to applyOverloaded.Dmitry Petrashko2014-11-222-4/+24
| | | | | | | | see annot.scala for examples
| * Annotations have JavaSeqLiterals inside.Dmitry Petrashko2014-11-221-1/+1
| |
| * Java annotations parsing problemDmitry Petrashko2014-11-221-1/+5
| | | | | | | | | | | | | | | | | | | | Annotations in java could be compiled as-if array-only annotation had <repeated> arguments constructor. That isn't true for scala. Also, type checking creation of single-element array requires implicit resolution to provide ClassTag. This makes problems while reading deferred annotation.
| * Extracting ApplyOverloaded to be reused in UnPickler and ClassfileParserDmitry Petrashko2014-11-224-16/+37
| |
| * AnnotationTransformer now also transforms typesDmitry Petrashko2014-11-222-4/+32
| | | | | | | | | | | | | | Required as gettersAndSetters ignores modifiers in tree and uses ones in the type instead. This means that gettersAndSetters carries over modifiers from type to tree and this one violates postconditions.
| * Extract AnnotationTransformer functionality from ElimRepeated to a traitDmitry Petrashko2014-11-222-37/+40
| | | | | | | | to be reused by FirstTransform
| * don't try to make a body for a setter of a Java fieldOndrej Lhotak2014-11-221-1/+1
| | | | | | | | | | | | | | | | transformSym explicitly checks that a field is JavaDefined and does not create a symbol for it. Creation of a setter body looks for the symbol and fails because it does not find it. We do not need setter bodies for Java fields because we are not generating bytecode for them.
| * create dummy first constructor for Java classesOndrej Lhotak2014-11-224-22/+26
| | | | | | | | | | | | The dummy constructor is needed so that the real constructors see the import of the companion object. The constructor has a parameter of type Unit so that no Java code can call it.