aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/typers.scala
Commit message (Collapse)AuthorAgeFilesLines
* Disallow refinements of types or methods that do not appear in parent.Martin Odersky2015-03-181-0/+1
| | | | | | | | We planned this for a long time but never implemented it. Instead, we sometimes issued an erro in Splitter, namely if reflection would have been needed to access the member. It turns out that some tests (e.g. neg/t625) fail -Ycheck (we knew that before and disabled) but also fail Pickling because they generate orhpan PolyParams. So rather than patching this up it seems now is a good time to enforce the restriction for real.
* Fix and enable RefChecksMartin Odersky2014-08-131-1/+1
| | | | RefChecks is now enabled. Some of the tests had to be fixed to be refchecks-correct.
* Enabled variance checkingMartin Odersky2014-08-031-1/+1
| | | | | | | Variance checking is now run as part of type-checking. Fixed tests that exhibited variance errors. Added tests where some classes of variance errors should be detected.
* TailRec phase and tests for it.Dmitry Petrashko2014-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Ported tailcall phase from scalac with such changes: - all transformation is done in the phase itself (previously half of the work was done in backend) - it is now able to run before uncurry - it is now a treeTransform - renamed to tailrec to make it more obvious that this phase transforms only recursive calls. For now this is a single phase which speculatively transforms DefDefs. Speculation can be potentially removed by splitting into 2 phases: one detecting which methods should be transformed second performing transformation. But, as transformation requires as same amount of work as detection, I believe it will be simpler to maintain it as a single phase. Conflicts: tests/pos/typers.scala
* Flag self names that conflict with parameters or membersMartin Odersky2014-04-081-41/+43
| | | | | | | | | A self name may no longer have the same name as a parameterless class member (or param accessor). The restriction makes sense because otherwise scoping is confusing. It's needed because otherwise we get TermRefs that have the same name and prefix but denote different things. Moved some code which exercises this from pos/typers to neg/typers
* Tweak to typing of function values.Martin Odersky2014-01-151-7/+14
| | | | We now propagte the expected function result type (if it exists) into the function body even if it not fully defined.
* Fix typing of unapplySeq extractor arguments.Martin Odersky2014-01-151-1/+12
| | | | Needed a special case for them.
* Making some traces conditional on printers being enabled.Martin Odersky2014-01-131-0/+6
|
* New subtype constraint maintenance algorithm.Martin Odersky2014-01-071-0/+5
| | | | | | | | | | Objective: Avoid cycles by detecting all cases where A <: B and B <: A and removing those cases by unifuing A and B. Cycles need to be avoided because they lead to deep subtype recursions.
* Generalize overloading resolution to type arguments.Martin Odersky2014-01-041-1/+4
| | | | | We need to take type arguments + value arguments into account when there are several overloaded alternatives that are all polymorphic and can be instantiated with the type arguments.
* Constraints need to be ignored when forming lubs and glbs of constrained ↵Martin Odersky2014-01-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | oarameter bounds. Otherwise we would get into situations like the following (experienced in typers.Arrays): Constraint: B >: String T >: B Add B >: T to this constraint. You get: B >: String | T, but because T >: B >: String, the rhs reduces to B >: T Simplified this gives B = T and the String lower bound has vanished!
* Adding a prototype of the right-hand side of default-getters.Martin Odersky2013-12-311-3/+12
|
* New version of eta-expansion.Martin Odersky2013-12-281-0/+4
| | | | | | | | This version expands a method ref p.m to the untyped tree p.m(_, ..., _) (after lifting impure expressions from p). Afterwards the usual application mechanisms kick in. This fixes problems also present in Scala 2.x, where an eta-expanded function was not as flexible as an explicitly expanded one (for instance, eta expansion did not honor default parameters).
* Making the name of self visible inside a class.Martin Odersky2013-12-251-0/+17
| | | | Previously, it wasn't.
* Fixing problems in treatment of private symbolsMartin Odersky2013-12-241-0/+15
| | | | | | | | | | | | 1) Accessibility check was broken because it looked at symbol's owner, where it should have looked at context owner. 2) Refined treatement if members. Previously, nonPrivate member returned a subset of member, i.e. those denotations returned by member that were not private. This is not correct. In a situation like class A { def x: Int = 1 } class B { private def x: String = "" } extends A (new B).x the non-private member returned should be A#x. Changed membersNamed and friends as well as checkAccessible to account for that.
* Fixes to desugaring and indexing package objectsMartin Odersky2013-12-171-0/+4
| | | | Plus some small tweaks in Typer
* Small tweaks to typerMartin Odersky2013-12-161-4/+7
|
* Better handling of cyclic reference errors.Martin Odersky2013-12-161-0/+8
|
* Checking for double definitions among class definitions.Martin Odersky2013-12-161-1/+1
| | | | | | Also fixes to typedReturn. Adapted tests accordingly.
* Fix to desugaring refinement types.Martin Odersky2013-12-161-1/+32
|
* Fixes to avoid stale symbols and to avoid methods as pattern constructors.Martin Odersky2013-12-091-0/+21